{
 "metadata": {
  "name": "",
  "signature": "sha256:21befa54ec44e79a7308a87f04b9d850ed7b6b5c346e194094033f7825a5a8bd"
 },
 "nbformat": 3,
 "nbformat_minor": 0,
 "worksheets": [
  {
   "cells": [
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sklearn.feature_extraction.text import CountVectorizer"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from pandas import Series, DataFrame"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import sys"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "sys.path.append('/Users/Pro/Ongoing/weibo')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from weiboPredict import framework as fw"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 3
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "reload(weibuframework)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "NameError",
       "evalue": "name 'weibuframework' is not defined",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-24-490c80477db3>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mreload\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mweibuframework\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;31mNameError\u001b[0m: name 'weibuframework' is not defined"
       ]
      }
     ],
     "prompt_number": 24
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.loadData()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "train_context_clean = Series.from_csv('data/train_context_clean.csv')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.weibo_train_data['context_clean'] = train_context_clean"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "vectorizer = CountVectorizer(analyzer = \"word\",   \\\n",
      "                             tokenizer = None,    \\\n",
      "                             preprocessor = None, \\\n",
      "                             stop_words = None,   \\\n",
      "                             max_features = 100) "
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_train_data_features = vectorizer.fit_transform(fw.weibo_train_data[(fw.weibo_train_data['time']<'2014-12-01') & \n",
      "                                                                       (fw.weibo_train_data['time']>='2014-11-01')].context_clean)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print vectorizer.get_feature_names()[99]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "u9ad8\n"
       ]
      }
     ],
     "prompt_number": 12
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print u'\\u9ad8'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\u9ad8\n"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_train_data_features = off_train_data_features.toarray()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_train_data_features.shape"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 15,
       "text": [
        "(268228, 100)"
       ]
      }
     ],
     "prompt_number": 15
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sklearn import linear_model"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 16
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import numpy as np"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 22
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "LR_off_train_forward = linear_model.LinearRegression()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 17
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "LR_off_train_forward.fit(off_train_data_features,fw.weibo_train_data[(fw.weibo_train_data.time<'2014-12-01') & \n",
      "                                                                       (fw.weibo_train_data['time']>='2014-11-01')].forward_count)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 18,
       "text": [
        "LinearRegression(copy_X=True, fit_intercept=True, normalize=False)"
       ]
      }
     ],
     "prompt_number": 18
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_train_data_forward = fw.weibo_train_data[(fw.weibo_train_data.time<'2014-12-01') & (fw.weibo_train_data['time']>='2014-11-01')].forward_count"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 28
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# The coefficients\n",
      "print 'Coefficients: \\n', LR_off_train_forward.coef_\n",
      "# The mean square error\n",
      "print \"Residual sum of squares: %.2f\" % np.mean((LR_off_train_forward.predict(off_train_data_features) - off_train_data_forward) ** 2)\n",
      "# Explained variance score: 1 is perfect prediction\n",
      "print 'Variance score: %.2f' % LR_off_train_forward.score(off_train_data_features, off_train_data_forward)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coefficients: \n",
        "[  1.28186683e+00   2.52042790e+00  -4.22240511e-01   3.00193074e-01\n",
        "   3.28058189e-01  -2.13529577e-01   3.27640197e-01  -3.49218136e-03\n",
        "  -7.51687673e-01   4.60758983e-01  -1.88868901e-01  -5.63483055e-01\n",
        "  -1.83995649e-01   2.93752622e-01  -1.97645411e-01  -1.79253901e-01\n",
        "  -2.06172987e-03   1.99173963e+00  -6.27022384e-01   6.15917705e-02\n",
        "   2.85340672e-01  -6.74744046e-01   3.22703508e-01  -1.93906428e-01\n",
        "  -7.66002106e-02  -3.09497938e-01  -3.45029518e-01   1.27872315e-01\n",
        "   3.79986469e-01   2.80729951e-01   8.66619194e-01   1.06845509e+00\n",
        "  -7.46800101e-01  -2.54218115e-01   2.73414376e+00  -1.47288430e-01\n",
        "  -1.01462568e+00   4.30055528e-01  -2.93930772e-01   3.81736449e-01\n",
        "  -3.66519904e-01   7.19002162e-01  -1.73325464e-01   3.24875449e-01\n",
        "  -4.16267259e-01   1.09335789e+00  -5.77318469e-01  -5.27257101e-02\n",
        "  -9.70816462e-01  -6.26686594e-01  -2.76311183e-01   9.30172159e-01\n",
        "   9.38379061e-01   1.63664274e-01   4.09739757e-01  -7.65133900e-01\n",
        "   3.31016884e-01  -2.58172161e-01   1.01198797e+00   1.77307286e+00\n",
        "   3.61991774e-02  -3.89654803e-01  -1.99074142e-01  -6.28604106e-01\n",
        "   9.55516554e-01  -7.35720041e-02  -4.58588853e-01  -2.23462541e-01\n",
        "   2.15590694e-01   8.00243970e-01   1.16599814e-01   2.19498519e+00\n",
        "  -2.66742669e-01  -4.14278221e-01  -1.95668630e-01  -9.36758394e-01\n",
        "  -4.17932271e-01  -3.16992248e-01   4.58014954e-01  -5.32611220e-01\n",
        "  -1.73775996e-01   7.05968914e-01   1.49674861e+00  -5.08237071e-01\n",
        "  -2.97077601e-01  -4.55922806e-01   2.16940611e-01   5.40526987e-02\n",
        "  -4.94225407e-01   1.04665258e+00   2.38683146e+00   2.94031871e+00\n",
        "  -9.84394767e-01   2.98732515e-01  -7.10995426e-02  -4.39575815e-01\n",
        "  -8.15566261e-01   2.66261832e-01  -4.48605915e-01  -2.35131478e-01]\n",
        "Residual sum of squares: 4199.03"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      }
     ],
     "prompt_number": 29
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_test_data_features = vectorizer.transform(fw.weibo_train_data[(fw.weibo_train_data['time']<='2014-12-31') & \n",
      "                                                                       (fw.weibo_train_data['time']>='2014-12-01')].context_clean)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 20
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_test_data_features = off_test_data_features.toarray()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 21
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_test_data_forward = fw.weibo_train_data[(fw.weibo_train_data.time<='2014-12-31') & (fw.weibo_train_data['time']>='2014-12-01')].forward_count"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 30
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "LR_off_test_forward = linear_model.LinearRegression()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 31
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "LR_off_test_forward.fit(off_test_data_features,off_test_data_forward)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 32,
       "text": [
        "LinearRegression(copy_X=True, fit_intercept=True, normalize=False)"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "# The coefficients\n",
      "print 'Coefficients: \\n', LR_off_test_forward.coef_\n",
      "# The mean square error\n",
      "print \"Residual sum of squares: %.2f\" % np.mean((LR_off_train_forward.predict(off_test_data_features) - off_test_data_forward) ** 2)\n",
      "# Explained variance score: 1 is perfect prediction\n",
      "print 'Variance score: %.2f' % LR_off_train_forward.score(off_test_data_features, off_test_data_forward)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Coefficients: \n",
        "[-0.1171739   0.63265743 -0.57442636  1.08746757  0.20182595  0.33553953\n",
        "  0.81983983 -0.0211989  -0.66764881  0.12984936 -0.24389544  0.36226616\n",
        "  0.06604472  0.20332698  0.50035616  0.28453848  0.26696837  0.33407466\n",
        " -0.51198033 -0.79661462  0.39749733 -0.55538544  1.22117418 -0.22280062\n",
        "  0.27924758  0.06368221 -0.07490052 -0.27374777 -0.32021338 -0.67411311\n",
        "  0.50933275  0.23655788 -0.45525629  0.0289753   2.67015218 -0.24295205\n",
        " -0.72936656  0.14092331  0.13797876  0.08975027 -0.09392222  0.5397419\n",
        " -0.28049526  0.09968362 -0.30238392  1.40514351 -0.19270185  0.05052858\n",
        " -0.82315137 -0.25508024 -0.44458304  0.84594892  0.21754754 -0.05292221\n",
        " -0.67396415 -0.30519182  0.85181616  0.55422181 -0.4006845   1.06301328\n",
        " -0.05069149 -0.3123591  -0.09636032 -0.22507588  0.747482   -0.24339028\n",
        " -0.63067304 -0.05132197  0.0145011  -0.04456321  0.16510655  1.78731256\n",
        "  0.45439284 -0.14257295 -0.45809281 -0.37898258 -0.02587705 -0.21514858\n",
        "  0.52580601 -0.38464043  0.23830032 -0.31960683  2.22860638 -0.53478454\n",
        " -0.22331493 -0.30997626  0.08812845 -0.2962532   0.06009859 -0.25908015\n",
        "  1.85063471  3.14683021 -0.51927151  0.13069531 -0.44594174  0.06274401\n",
        " -0.04162402 -0.61135463 -0.6250505  -0.10684694]\n",
        "Residual sum of squares: 2902.73"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_predict_forward = LR_off_train_forward.predict(off_test_data_features)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 35
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_test_data_forward[20:40]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 55,
       "text": [
        "73     0\n",
        "81     0\n",
        "82     0\n",
        "119    0\n",
        "120    0\n",
        "121    0\n",
        "122    0\n",
        "123    0\n",
        "124    0\n",
        "183    0\n",
        "300    0\n",
        "301    0\n",
        "302    2\n",
        "303    1\n",
        "304    0\n",
        "305    0\n",
        "306    0\n",
        "307    0\n",
        "308    0\n",
        "309    2\n",
        "Name: forward_count, dtype: int64"
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "Series(off_predict_forward)[20:40].round()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 58,
       "text": [
        "20    1\n",
        "21    0\n",
        "22    1\n",
        "23    0\n",
        "24    2\n",
        "25    3\n",
        "26   -0\n",
        "27   -0\n",
        "28   -0\n",
        "29    2\n",
        "30    4\n",
        "31    2\n",
        "32    6\n",
        "33   -6\n",
        "34   -3\n",
        "35    5\n",
        "36   -1\n",
        "37    4\n",
        "38    3\n",
        "39    2\n",
        "dtype: float64"
       ]
      }
     ],
     "prompt_number": 58
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "off_test_data_forward.count()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 49,
       "text": [
        "272702"
       ]
      }
     ],
     "prompt_number": 49
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train('2014-11-01','2014-11-30','forward_count','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Coefficients: \n",
        "[  1.28186683e+00   2.52042790e+00  -4.22240511e-01   3.00193074e-01\n",
        "   3.28058189e-01  -2.13529577e-01   3.27640197e-01  -3.49218136e-03\n",
        "  -7.51687673e-01   4.60758983e-01  -1.88868901e-01  -5.63483055e-01\n",
        "  -1.83995649e-01   2.93752622e-01  -1.97645411e-01  -1.79253901e-01\n",
        "  -2.06172987e-03   1.99173963e+00  -6.27022384e-01   6.15917705e-02\n",
        "   2.85340672e-01  -6.74744046e-01   3.22703508e-01  -1.93906428e-01\n",
        "  -7.66002106e-02  -3.09497938e-01  -3.45029518e-01   1.27872315e-01\n",
        "   3.79986469e-01   2.80729951e-01   8.66619194e-01   1.06845509e+00\n",
        "  -7.46800101e-01  -2.54218115e-01   2.73414376e+00  -1.47288430e-01\n",
        "  -1.01462568e+00   4.30055528e-01  -2.93930772e-01   3.81736449e-01\n",
        "  -3.66519904e-01   7.19002162e-01  -1.73325464e-01   3.24875449e-01\n",
        "  -4.16267259e-01   1.09335789e+00  -5.77318469e-01  -5.27257101e-02\n",
        "  -9.70816462e-01  -6.26686594e-01  -2.76311183e-01   9.30172159e-01\n",
        "   9.38379061e-01   1.63664274e-01   4.09739757e-01  -7.65133900e-01\n",
        "   3.31016884e-01  -2.58172161e-01   1.01198797e+00   1.77307286e+00\n",
        "   3.61991774e-02  -3.89654803e-01  -1.99074142e-01  -6.28604106e-01\n",
        "   9.55516554e-01  -7.35720041e-02  -4.58588853e-01  -2.23462541e-01\n",
        "   2.15590694e-01   8.00243970e-01   1.16599814e-01   2.19498519e+00\n",
        "  -2.66742669e-01  -4.14278221e-01  -1.95668630e-01  -9.36758394e-01\n",
        "  -4.17932271e-01  -3.16992248e-01   4.58014954e-01  -5.32611220e-01\n",
        "  -1.73775996e-01   7.05968914e-01   1.49674861e+00  -5.08237071e-01\n",
        "  -2.97077601e-01  -4.55922806e-01   2.16940611e-01   5.40526987e-02\n",
        "  -4.94225407e-01   1.04665258e+00   2.38683146e+00   2.94031871e+00\n",
        "  -9.84394767e-01   2.98732515e-01  -7.10995426e-02  -4.39575815e-01\n",
        "  -8.15566261e-01   2.66261832e-01  -4.48605915e-01  -2.35131478e-01]\n",
        "Residual sum of squares: 4199.03"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "(LinearRegression(copy_X=True, fit_intercept=True, normalize=False),\n",
        " CountVectorizer(analyzer='word', binary=False, charset=None,\n",
        "         charset_error=None, decode_error=u'strict',\n",
        "         dtype=<type 'numpy.int64'>, encoding=u'utf-8', input=u'content',\n",
        "         lowercase=True, max_df=1.0, max_features=100, min_df=1,\n",
        "         ngram_range=(1, 1), preprocessor=None, stop_words=None,\n",
        "         strip_accents=None, token_pattern=u'(?u)\\\\b\\\\w\\\\w+\\\\b',\n",
        "         tokenizer=None, vocabulary=None))"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train('2014-11-01','2014-11-30','comment_count','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Coefficients: \n",
        "[ -5.48021189e-02   3.36926807e-01  -2.26590710e-01  -2.20197053e-01\n",
        "   6.34193163e-02   9.35210967e-02   2.94180906e-02   8.43914985e-02\n",
        "  -1.10065440e-01   1.23503168e-01  -6.17640254e-02  -8.14676087e-02\n",
        "  -4.22214694e-01  -1.65547759e-02   6.95582007e-02  -2.39832670e-02\n",
        "   3.03822848e-03   2.98584369e-01  -8.83884021e-02  -3.35576689e-02\n",
        "  -6.18194081e-02  -4.23327797e-02   1.08468910e-01  -2.76006260e-02\n",
        "   8.25205886e-02   2.88742706e-01  -5.11126427e-02   9.82266127e-03\n",
        "  -1.18862852e-01   6.24596154e-02   1.75720389e-01   3.12308867e-01\n",
        "  -2.47953192e-01   5.01535418e-02   4.31854065e-01   7.81112297e-02\n",
        "  -6.86949390e-02   9.89852008e-02   1.79509237e-02   7.24494990e-02\n",
        "   5.82741060e-02   3.70133593e-02   6.73685250e-02  -2.78569718e-02\n",
        "  -5.21591029e-02   1.86347958e-01   2.03145793e-02  -3.69393177e-02\n",
        "  -5.56649695e-02  -9.24578584e-02  -1.35707749e-02   2.02227840e-01\n",
        "   1.45967831e-01  -7.02052374e-02  -1.30948533e-01  -4.60269717e-02\n",
        "   3.09557408e-01  -1.40843820e-01   9.14133431e-02   8.09894862e-02\n",
        "  -1.67236388e-02  -7.30841889e-02  -1.91157043e-01  -6.72994677e-02\n",
        "  -1.46448884e-02   1.18179076e-02  -4.60167612e-02   2.43925962e-01\n",
        "   5.93144146e-02   5.10619348e-02   2.09926316e-01   3.75282157e-01\n",
        "   1.07134460e-01   5.62278518e-03   2.69701063e-02  -1.34951037e-01\n",
        "  -1.45537867e-01  -3.43865138e-02  -3.95546410e-02  -1.38042511e-05\n",
        "   9.25680231e-02   2.88787013e-01   1.53533063e-01  -1.28072351e-01\n",
        "  -1.51860081e-01  -1.38200121e-01   9.49029792e-02  -7.15848570e-02\n",
        "  -1.08185792e-01   4.44778184e-02   2.11973256e-01   2.17028336e-01\n",
        "  -2.90511065e-01   2.16476208e-01   5.47138040e-02  -6.15375553e-02\n",
        "  -1.85414425e-01   7.36057934e-02  -3.42724656e-01  -3.42540838e-02]\n",
        "Residual sum of squares: 116.05"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "(LinearRegression(copy_X=True, fit_intercept=True, normalize=False),\n",
        " CountVectorizer(analyzer='word', binary=False, charset=None,\n",
        "         charset_error=None, decode_error=u'strict',\n",
        "         dtype=<type 'numpy.int64'>, encoding=u'utf-8', input=u'content',\n",
        "         lowercase=True, max_df=1.0, max_features=100, min_df=1,\n",
        "         ngram_range=(1, 1), preprocessor=None, stop_words=None,\n",
        "         strip_accents=None, token_pattern=u'(?u)\\\\b\\\\w\\\\w+\\\\b',\n",
        "         tokenizer=None, vocabulary=None))"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train('2014-11-01','2014-11-30','like_count','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Coefficients: \n",
        "[-0.03498562  0.92573918 -0.24072069  0.05022702  0.22343924  0.01963239\n",
        " -0.01727218 -0.04870449 -0.21841034  0.16536675 -0.13678465 -0.20647711\n",
        "  0.10145475  0.08461994  0.56062857 -0.10575687 -0.04758359  0.55141328\n",
        " -0.13299707 -0.27851467 -0.355312   -0.16302811  0.08606958 -0.11191576\n",
        "  0.08134696  0.04134319  0.0916613  -0.09168231  0.04276693 -0.53126058\n",
        " -0.02649976  0.36133313 -0.34640574 -0.06846871  1.28609185 -0.18110172\n",
        " -0.41951234  0.10396317 -0.0899575   0.03390457 -0.13968321  0.39069009\n",
        "  0.32368811  0.0450736  -0.11582036  0.74940391 -0.1730606  -0.12021148\n",
        " -0.36583899 -0.35423146 -0.19683539  0.04677618  0.12360646  0.11618579\n",
        " -0.06020034 -0.19351281  0.26682715  0.0127597   0.51764763  0.75594759\n",
        " -0.04006534 -0.27391623 -0.05792357 -0.11683252  0.29423461 -0.22318789\n",
        " -0.01700471  0.10721765  0.17661956 -0.14595267 -0.0505201   0.10547702\n",
        " -0.49594948 -0.11380088 -0.1254195  -0.22176857 -0.14365751 -0.09987293\n",
        "  0.22745255  0.07706725  0.15640435 -0.09049082  0.47726094 -0.26663188\n",
        " -0.23966526 -0.08508519  0.06820634 -0.29525509 -0.08851632 -0.07081593\n",
        "  1.33498205  0.83433618 -0.47522345  0.01548143  0.16795369  0.05305045\n",
        " -0.26225649 -0.02570609 -0.29633304 -0.00503804]\n",
        "Residual sum of squares: 564.80"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "(LinearRegression(copy_X=True, fit_intercept=True, normalize=False),\n",
        " CountVectorizer(analyzer='word', binary=False, charset=None,\n",
        "         charset_error=None, decode_error=u'strict',\n",
        "         dtype=<type 'numpy.int64'>, encoding=u'utf-8', input=u'content',\n",
        "         lowercase=True, max_df=1.0, max_features=100, min_df=1,\n",
        "         ngram_range=(1, 1), preprocessor=None, stop_words=None,\n",
        "         strip_accents=None, token_pattern=u'(?u)\\\\b\\\\w\\\\w+\\\\b',\n",
        "         tokenizer=None, vocabulary=None))"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a=DataFrame({'a':[1,2,3],'b':[4,5,6],'c':[7,8,9]})"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 31
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from pandas import Series, DataFrame"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b = DataFrame([[1,1,1],[1,1,1],[1,1,1]])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 41
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "c = DataFrame([[2,2,2],[4,4,4],[8,8,8]])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 42
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>a</th>\n",
        "      <th>b</th>\n",
        "      <th>c</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 7</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 2</td>\n",
        "      <td> 5</td>\n",
        "      <td> 8</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 3</td>\n",
        "      <td> 6</td>\n",
        "      <td> 9</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 32,
       "text": [
        "   a  b  c\n",
        "0  1  4  7\n",
        "1  2  5  8\n",
        "2  3  6  9"
       ]
      }
     ],
     "prompt_number": 32
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "d=Series([2,2,2])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 21
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a/d"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>0</th>\n",
        "      <th>1</th>\n",
        "      <th>2</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 0.5</td>\n",
        "      <td> 1.0</td>\n",
        "      <td> 1.5</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 2.0</td>\n",
        "      <td> 2.5</td>\n",
        "      <td> 3.0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 3.5</td>\n",
        "      <td> 4.0</td>\n",
        "      <td> 4.5</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 22,
       "text": [
        "     0    1    2\n",
        "0  0.5  1.0  1.5\n",
        "1  2.0  2.5  3.0\n",
        "2  3.5  4.0  4.5"
       ]
      }
     ],
     "prompt_number": 22
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "DataFrame?"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 29
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "1-a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>a</th>\n",
        "      <th>b</th>\n",
        "      <th>c</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 0</td>\n",
        "      <td>-3</td>\n",
        "      <td>-6</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td>-1</td>\n",
        "      <td>-4</td>\n",
        "      <td>-7</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td>-2</td>\n",
        "      <td>-5</td>\n",
        "      <td>-8</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 33,
       "text": [
        "   a  b  c\n",
        "0  0 -3 -6\n",
        "1 -1 -4 -7\n",
        "2 -2 -5 -8"
       ]
      }
     ],
     "prompt_number": 33
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>a</th>\n",
        "      <th>b</th>\n",
        "      <th>c</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 7</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 2</td>\n",
        "      <td> 5</td>\n",
        "      <td> 8</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 3</td>\n",
        "      <td> 6</td>\n",
        "      <td> 9</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 34,
       "text": [
        "   a  b  c\n",
        "0  1  4  7\n",
        "1  2  5  8\n",
        "2  3  6  9"
       ]
      }
     ],
     "prompt_number": 34
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "type(a.a+a.b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 39,
       "text": [
        "pandas.core.series.Series"
       ]
      }
     ],
     "prompt_number": 39
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a."
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "Object `a.map` not found.\n"
       ]
      }
     ],
     "prompt_number": 37
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b[0].sum()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 52,
       "text": [
        "3"
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.test('2014-12-01','2014-12-31','2014-11-01','2014-11-30','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Forward_count\n",
        "Residual sum of squares: 2902.06\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Comment_count\n",
        "Residual sum of squares: 168.50\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Like_count\n",
        "Residual sum of squares: 348.56\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Total_precision:0.209309573998\n"
       ]
      },
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>comment_predict</th>\n",
        "      <th>forward_predict</th>\n",
        "      <th>like_predict</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3     </th>\n",
        "      <td> 0</td>\n",
        "      <td>  6</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  4</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9     </th>\n",
        "      <td> 0</td>\n",
        "      <td>  3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  6</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>21    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>22    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>23    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>24    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>25    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>26    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>27    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>28    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>29    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>...</th>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272672</th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272673</th>\n",
        "      <td> 1</td>\n",
        "      <td>  5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272674</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272675</th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272676</th>\n",
        "      <td> 2</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272677</th>\n",
        "      <td> 3</td>\n",
        "      <td> 13</td>\n",
        "      <td> 6</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272678</th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272679</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272680</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272681</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272682</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272683</th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272684</th>\n",
        "      <td> 1</td>\n",
        "      <td>  4</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272685</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272686</th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272687</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272688</th>\n",
        "      <td> 1</td>\n",
        "      <td>  5</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272689</th>\n",
        "      <td> 2</td>\n",
        "      <td> 10</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272690</th>\n",
        "      <td> 3</td>\n",
        "      <td> 14</td>\n",
        "      <td> 6</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272691</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272692</th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272693</th>\n",
        "      <td> 2</td>\n",
        "      <td>  5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272694</th>\n",
        "      <td> 1</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272695</th>\n",
        "      <td> 2</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272696</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272697</th>\n",
        "      <td> 2</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272698</th>\n",
        "      <td> 2</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272699</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272700</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272701</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>272702 rows \u00d7 3 columns</p>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "        comment_predict  forward_predict  like_predict\n",
        "0                     1                2             1\n",
        "1                     1                2             2\n",
        "2                     1                1             1\n",
        "3                     0                6             3\n",
        "4                     1                4             1\n",
        "5                     1                1             1\n",
        "6                     1                1             1\n",
        "7                     1                1             1\n",
        "8                     1                1             1\n",
        "9                     0                3             2\n",
        "10                    0                3             2\n",
        "11                    1                4             2\n",
        "12                    1                6             2\n",
        "13                    1                1             1\n",
        "14                    1                1             1\n",
        "15                    1                1             1\n",
        "16                    1                1             1\n",
        "17                    1                1             1\n",
        "18                    1                2             1\n",
        "19                    1                2             1\n",
        "20                    1                1             1\n",
        "21                    0                0             1\n",
        "22                    1                1             1\n",
        "23                    0                0             0\n",
        "24                    1                2             1\n",
        "25                    1                3             2\n",
        "26                    1                0             1\n",
        "27                    1                0             1\n",
        "28                    1                0             0\n",
        "29                    1                2             2\n",
        "...                 ...              ...           ...\n",
        "272672                1                3             3\n",
        "272673                1                5             2\n",
        "272674                1                1             1\n",
        "272675                1                0             2\n",
        "272676                2                4             2\n",
        "272677                3               13             6\n",
        "272678                1                0             1\n",
        "272679                1                1             1\n",
        "272680                0                0             0\n",
        "272681                1                2             2\n",
        "272682                1                1             1\n",
        "272683                1                0             1\n",
        "272684                1                4             3\n",
        "272685                0                0             1\n",
        "272686                1                3             1\n",
        "272687                1                1             1\n",
        "272688                1                5             3\n",
        "272689                2               10             2\n",
        "272690                3               14             6\n",
        "272691                1                2             2\n",
        "272692                1                0             1\n",
        "272693                2                5             2\n",
        "272694                1                4             2\n",
        "272695                2                4             2\n",
        "272696                1                1             1\n",
        "272697                2                4             2\n",
        "272698                2                4             2\n",
        "272699                1                2             2\n",
        "272700                0                0             1\n",
        "272701                0                0             1\n",
        "\n",
        "[272702 rows x 3 columns]"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p=fw.test('2014-12-01','2014-12-31','2014-11-01','2014-11-30','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Forward_count\n",
        "Residual sum of squares: 2907.21\n",
        "Variance score: -0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Comment_count\n",
        "Residual sum of squares: 168.66\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Like_count\n",
        "Residual sum of squares: 350.04\n",
        "Variance score: -0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Total_precision:0.208966521519\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "p"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>comment_predict</th>\n",
        "      <th>forward_predict</th>\n",
        "      <th>like_predict</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 6</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>21    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>22    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>23    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>24    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>25    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>26    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>27    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>28    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>29    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>...</th>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272672</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272673</th>\n",
        "      <td> 1</td>\n",
        "      <td> 5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272674</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272675</th>\n",
        "      <td> 3</td>\n",
        "      <td> 9</td>\n",
        "      <td> 5</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272676</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272677</th>\n",
        "      <td> 3</td>\n",
        "      <td> 9</td>\n",
        "      <td> 4</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272678</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272679</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272680</th>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272681</th>\n",
        "      <td> 1</td>\n",
        "      <td> 3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272682</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272683</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272684</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272685</th>\n",
        "      <td> 1</td>\n",
        "      <td> 5</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272686</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272687</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272688</th>\n",
        "      <td> 1</td>\n",
        "      <td> 3</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272689</th>\n",
        "      <td> 1</td>\n",
        "      <td> 7</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272690</th>\n",
        "      <td> 1</td>\n",
        "      <td> 6</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272691</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272692</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272693</th>\n",
        "      <td> 2</td>\n",
        "      <td> 6</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272694</th>\n",
        "      <td> 1</td>\n",
        "      <td> 5</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272695</th>\n",
        "      <td> 2</td>\n",
        "      <td> 5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272696</th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272697</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272698</th>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272699</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272700</th>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>272701</th>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>272702 rows \u00d7 3 columns</p>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "        comment_predict  forward_predict  like_predict\n",
        "0                     1                0             0\n",
        "1                     1                0             1\n",
        "2                     1                1             1\n",
        "3                     1                3             1\n",
        "4                     1                5             2\n",
        "5                     1                1             1\n",
        "6                     1                1             1\n",
        "7                     1                1             1\n",
        "8                     1                1             1\n",
        "9                     1                4             2\n",
        "10                    1                4             2\n",
        "11                    1                4             2\n",
        "12                    1                6             3\n",
        "13                    1                1             1\n",
        "14                    1                1             1\n",
        "15                    1                1             1\n",
        "16                    1                1             1\n",
        "17                    1                2             2\n",
        "18                    1                0             1\n",
        "19                    1                4             1\n",
        "20                    1                2             2\n",
        "21                    0                0             1\n",
        "22                    1                2             1\n",
        "23                    0                0             0\n",
        "24                    1                2             1\n",
        "25                    1                3             2\n",
        "26                    2                5             2\n",
        "27                    1                2             1\n",
        "28                    1                1             1\n",
        "29                    1                1             1\n",
        "...                 ...              ...           ...\n",
        "272672                1                1             3\n",
        "272673                1                5             2\n",
        "272674                1                1             1\n",
        "272675                3                9             5\n",
        "272676                1                0             1\n",
        "272677                3                9             4\n",
        "272678                1                0             0\n",
        "272679                1                1             1\n",
        "272680                0                2             2\n",
        "272681                1                3             1\n",
        "272682                1                1             1\n",
        "272683                1                1             1\n",
        "272684                1                2             1\n",
        "272685                1                5             3\n",
        "272686                1                2             1\n",
        "272687                1                0             1\n",
        "272688                1                3             3\n",
        "272689                1                7             2\n",
        "272690                1                6             3\n",
        "272691                1                1             2\n",
        "272692                1                0             0\n",
        "272693                2                6             3\n",
        "272694                1                5             3\n",
        "272695                2                5             2\n",
        "272696                1                1             1\n",
        "272697                1                2             2\n",
        "272698                2                2             1\n",
        "272699                1                0             1\n",
        "272700                0                1             1\n",
        "272701                0                1             1\n",
        "\n",
        "[272702 rows x 3 columns]"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train('2014-12-01','2014-12-31','forward_count','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Coefficients: \n",
        "[-0.07902232  0.62868399 -0.59987048  1.12680678  0.25285523  0.37292919\n",
        "  0.78672905 -0.04092331 -0.69031083  0.08649835 -0.26411553  0.25508029\n",
        "  0.06649871  0.19260446  0.51952483  0.2368782   0.27427116  0.33263336\n",
        " -0.50869069 -0.69586864  0.40018048 -0.55830159  1.2327499  -0.21484603\n",
        "  0.34158949  0.0359689  -0.09771433 -0.20168368 -0.26528007  0.9104637\n",
        " -0.63183433  0.55724881  0.21997317 -0.44008933  0.03013537  2.6121762\n",
        " -0.34752086 -0.70807969  0.16925535  0.11534274  0.09706336 -0.10656968\n",
        "  0.53747476 -0.30612798  0.01500541 -0.31092618  1.42216513 -0.21860581\n",
        "  0.07482546 -0.27508883 -0.51322995  0.80900871  0.21847684 -0.0693062\n",
        " -0.17945211 -0.30428814  0.48487876 -0.71730579 -0.43401712  0.62281598\n",
        "  1.0234972  -0.09131368 -0.31247005 -0.12203225 -0.2098593   0.71514351\n",
        " -0.22614956 -0.66580316 -0.01933768 -0.07748842  0.08621418  1.72120611\n",
        "  0.45752047 -0.0936166   0.62778682 -0.33695046 -0.28835273 -0.07917479\n",
        " -0.23741527  0.57026055 -0.38884181  0.17664262  2.14529911 -1.4906589\n",
        " -0.54169845 -0.19052485 -0.37770932 -0.29083163 -0.27046931  1.81928419\n",
        " -0.10638814  3.12420752 -0.49360446  0.09146202 -0.6252839  -0.61050424\n",
        " -0.02774037 -0.67768242 -0.63557121 -0.08457444]\n",
        "Residual sum of squares: 2898.71"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 7,
       "text": [
        "(LinearRegression(copy_X=True, fit_intercept=True, normalize=False),\n",
        " CountVectorizer(analyzer='word', binary=False, charset=None,\n",
        "         charset_error=None, decode_error=u'strict',\n",
        "         dtype=<type 'numpy.int64'>, encoding=u'utf-8', input=u'content',\n",
        "         lowercase=True, max_df=1.0, max_features=100, min_df=1,\n",
        "         ngram_range=(1, 1), preprocessor=None, stop_words=None,\n",
        "         strip_accents=None, token_pattern=u'(?u)\\\\b\\\\w\\\\w+\\\\b',\n",
        "         tokenizer=None, vocabulary=None))"
       ]
      }
     ],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train('2014-12-01','2014-12-31','comment_count','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Coefficients: \n",
        "[-0.3544407   0.2636284  -0.31811937  0.01504469  0.0837211   0.29333252\n",
        "  0.16056513  0.06406856 -0.14142798  0.03980229  0.00642139  0.13744669\n",
        " -0.29095999  0.03962623  0.0935755  -0.01622373 -0.00829307  0.01370294\n",
        " -0.02254528 -0.26398483 -0.10088943 -0.07764128  0.34087905 -0.07377746\n",
        "  0.00763931 -0.0024715  -0.01712767 -0.10333732 -0.03789527 -0.09047405\n",
        " -0.15832133  0.21899743  0.11785172 -0.19975262 -0.01311605  0.44525502\n",
        "  0.01656445 -0.17276388 -0.02123905  0.11467834  0.11764574  0.06606412\n",
        "  0.074538    0.12613375 -0.07961926  0.00972263  0.24946739 -0.00283674\n",
        "  0.01560391 -0.09424761 -0.0915591   0.21750649  0.03883534 -0.09917429\n",
        " -0.06078987  0.08752001 -0.00117132 -0.05158918 -0.25215046  0.07130794\n",
        "  0.06176012  0.26581946 -0.3052308  -0.20934559 -0.06309622 -0.00953583\n",
        " -0.14258173 -0.14007982  0.04158433  0.06997716  0.06974326  0.59589269\n",
        "  0.23133748 -0.03901793 -0.05045831  0.10399464 -0.05495833  0.04343938\n",
        "  0.01469241 -0.00803848 -0.05439686  0.20619959  0.247238   -0.26098206\n",
        " -0.03415514 -0.08742705 -0.06327643 -0.05993939 -0.06667439  0.05857294\n",
        " -0.09344364  0.36204137 -0.08513513  0.31475506 -0.13837056 -0.10907669\n",
        " -0.07979526 -0.05547516 -0.26161309 -0.070535  ]\n",
        "Residual sum of squares: 168.27"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 8,
       "text": [
        "(LinearRegression(copy_X=True, fit_intercept=True, normalize=False),\n",
        " CountVectorizer(analyzer='word', binary=False, charset=None,\n",
        "         charset_error=None, decode_error=u'strict',\n",
        "         dtype=<type 'numpy.int64'>, encoding=u'utf-8', input=u'content',\n",
        "         lowercase=True, max_df=1.0, max_features=100, min_df=1,\n",
        "         ngram_range=(1, 1), preprocessor=None, stop_words=None,\n",
        "         strip_accents=None, token_pattern=u'(?u)\\\\b\\\\w\\\\w+\\\\b',\n",
        "         tokenizer=None, vocabulary=None))"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train('2014-12-01','2014-12-31','like_count','BOW','LR')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "=====BOW_LR=====\n",
        "Coefficients: \n",
        "[ -2.77474558e-01   2.50548616e-01  -3.70565922e-01   3.39230012e-01\n",
        "   2.34655755e-01   1.65008560e-01   2.06600559e-01  -2.86185069e-02\n",
        "  -2.02352245e-01  -1.23708299e-02  -2.89572958e-02  -1.72133459e-02\n",
        "   2.57051545e-01   8.90307915e-02   5.66418631e-01  -8.11263804e-02\n",
        "  -1.46233595e-01   3.72490449e-01  -9.93580556e-02  -3.57098466e-01\n",
        "  -2.07288615e-01  -1.71411599e-01   2.85616519e-01  -1.27961847e-01\n",
        "   1.30758384e-01  -9.79730696e-02   1.33889144e-01  -1.52492570e-01\n",
        "  -5.42971064e-02   4.30329060e-01  -4.55487782e-01  -4.70663687e-04\n",
        "   1.75704071e-01  -2.32827314e-01  -3.78213637e-02   7.47994246e-01\n",
        "  -1.25002295e-01  -2.35257444e-01   3.70471373e-02   1.92913540e-02\n",
        "  -1.98285094e-02  -7.84786871e-02   2.88390421e-01   1.34124793e-01\n",
        "  -2.11760844e-02  -7.96304382e-02   7.32543114e-01  -2.03081796e-01\n",
        "  -1.40748245e-02  -1.36818989e-01  -1.78358932e-01   3.75297864e-01\n",
        "   5.14226758e-02   5.45319341e-02  -1.46585270e-01   7.29989457e-02\n",
        "  -1.50514354e-01  -3.33753368e-01   1.39110053e-01   3.20123055e-01\n",
        "   3.59035261e-01   3.60803977e-01  -5.40932500e-01  -7.54184287e-02\n",
        "  -8.24409910e-02   1.19156796e-01  -1.97098254e-01  -1.55240755e-01\n",
        "  -5.35575920e-03  -1.49822298e-01  -3.90683449e-02  -6.16837854e-02\n",
        "  -3.08934439e-01  -1.07926026e-01   8.52819277e-03  -4.65402921e-02\n",
        "  -1.18604698e-01   1.49051585e-01  -7.73010776e-02   2.08618508e-01\n",
        "  -9.11874340e-02   3.73620524e-01   3.83757887e-01  -6.72988580e-01\n",
        "   1.16576704e-01  -6.83820791e-02   4.47164253e-02  -1.71984082e-01\n",
        "  -1.00858049e-01   8.41013764e-01  -1.45414653e-01   7.79279038e-01\n",
        "  -2.70476632e-01   1.92380751e-01  -3.67681117e-01  -2.99833104e-01\n",
        "  -1.12937068e-01  -1.09421443e-01  -3.74748001e-01  -9.59896979e-02]\n",
        "Residual sum of squares: 348.20"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "Variance score: 0.00"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 9,
       "text": [
        "(LinearRegression(copy_X=True, fit_intercept=True, normalize=False),\n",
        " CountVectorizer(analyzer='word', binary=False, charset=None,\n",
        "         charset_error=None, decode_error=u'strict',\n",
        "         dtype=<type 'numpy.int64'>, encoding=u'utf-8', input=u'content',\n",
        "         lowercase=True, max_df=1.0, max_features=100, min_df=1,\n",
        "         ngram_range=(1, 1), preprocessor=None, stop_words=None,\n",
        "         strip_accents=None, token_pattern=u'(?u)\\\\b\\\\w\\\\w+\\\\b',\n",
        "         tokenizer=None, vocabulary=None))"
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "'2014-12-31'<'2015-01-01'"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 14,
       "text": [
        "True"
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "prediction = fw.test('2015-01-01','2015-01-31','2014-12-01','2014-12-31','BOW','LR',evaluation=False)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "uid              275331\n",
        "mid              275331\n",
        "time             275331\n",
        "context          275331\n",
        "context_clean    275331\n",
        "dtype: int64\n"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "prediction"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>comment_predict</th>\n",
        "      <th>forward_predict</th>\n",
        "      <th>like_predict</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  9</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6     </th>\n",
        "      <td> 0</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9     </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>21    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>22    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>23    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>24    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>25    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>26    </th>\n",
        "      <td> 0</td>\n",
        "      <td>  1</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>27    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>28    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 13</td>\n",
        "      <td> 5</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>29    </th>\n",
        "      <td> 1</td>\n",
        "      <td>  4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>...</th>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275301</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275302</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275303</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275304</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275305</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275306</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275307</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275308</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275309</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275310</th>\n",
        "      <td> 2</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275311</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275312</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275313</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275314</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275315</th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275316</th>\n",
        "      <td> 1</td>\n",
        "      <td> 12</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275317</th>\n",
        "      <td> 0</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275318</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275319</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275320</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275321</th>\n",
        "      <td> 1</td>\n",
        "      <td>  2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275322</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275323</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275324</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275325</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275326</th>\n",
        "      <td> 2</td>\n",
        "      <td>  3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275327</th>\n",
        "      <td> 2</td>\n",
        "      <td>  3</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275328</th>\n",
        "      <td> 1</td>\n",
        "      <td>  1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275329</th>\n",
        "      <td> 1</td>\n",
        "      <td>  0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275330</th>\n",
        "      <td> 0</td>\n",
        "      <td>  0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>275331 rows \u00d7 3 columns</p>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 6,
       "text": [
        "        comment_predict  forward_predict  like_predict\n",
        "0                     1                1             1\n",
        "1                     1                1             1\n",
        "2                     1                2             1\n",
        "3                     1                2             1\n",
        "4                     1                9             3\n",
        "5                     1                1             1\n",
        "6                     0                1             1\n",
        "7                     1                2             1\n",
        "8                     1                1             1\n",
        "9                     1                1             1\n",
        "10                    1                1             1\n",
        "11                    1                2             1\n",
        "12                    1                3             1\n",
        "13                    1                1             1\n",
        "14                    1                1             1\n",
        "15                    1                1             1\n",
        "16                    1                1             1\n",
        "17                    0                0             1\n",
        "18                    0                0             0\n",
        "19                    0                0             0\n",
        "20                    1                1             0\n",
        "21                    1                1             0\n",
        "22                    1                2             1\n",
        "23                    1                3             1\n",
        "24                    1                3             1\n",
        "25                    1                3             1\n",
        "26                    0                1             0\n",
        "27                    1                1             2\n",
        "28                    1               13             5\n",
        "29                    1                4             2\n",
        "...                 ...              ...           ...\n",
        "275301                0                0             1\n",
        "275302                0                0             1\n",
        "275303                0                0             1\n",
        "275304                1                1             1\n",
        "275305                1                1             1\n",
        "275306                1                1             1\n",
        "275307                1                1             1\n",
        "275308                1                2             1\n",
        "275309                1                2             1\n",
        "275310                2                2             1\n",
        "275311                1                1             1\n",
        "275312                1                1             1\n",
        "275313                1                2             1\n",
        "275314                1                1             1\n",
        "275315                1                0             1\n",
        "275316                1               12             3\n",
        "275317                0                2             1\n",
        "275318                1                2             2\n",
        "275319                1                1             0\n",
        "275320                1                2             1\n",
        "275321                1                2             1\n",
        "275322                0                0             0\n",
        "275323                0                0             0\n",
        "275324                0                0             0\n",
        "275325                0                0             0\n",
        "275326                2                3             2\n",
        "275327                2                3             1\n",
        "275328                1                1             1\n",
        "275329                1                0             1\n",
        "275330                0                0             0\n",
        "\n",
        "[275331 rows x 3 columns]"
       ]
      }
     ],
     "prompt_number": 6
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.weibo_predict_data[['forward_count','comment_count','like_count']] = prediction"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 7
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.weibo_predict_data.head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>uid</th>\n",
        "      <th>mid</th>\n",
        "      <th>time</th>\n",
        "      <th>context</th>\n",
        "      <th>context_clean</th>\n",
        "      <th>forward_count</th>\n",
        "      <th>comment_count</th>\n",
        "      <th>like_count</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> f03b783f63a9cda982eaef22286445ad</td>\n",
        "      <td> 2015-01-01</td>\n",
        "      <td>                              [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing</td>\n",
        "      <td> [u'doge', u'\\u9996\\u80dc', u'\\u5df2', u'\\u70e7...</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 8d869b3e8dae07ca346a9642665103d2</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td>                                   [doge]fzuer.com</td>\n",
        "      <td>                       [u'doge', u'fzuer', u'com']</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 61dc72d7e1e38aa72d18ffa2c21c98e8</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td> [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...</td>\n",
        "      <td> [u'\\u601d\\u8003', u'TX', u'\\u57df\\u540d', u'\\u...</td>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 9cc17196a9800b5d76504c9618736d95</td>\n",
        "      <td> 2015-01-08</td>\n",
        "      <td>                               \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]</td>\n",
        "      <td> [u'\\u671d\\u95fb', u'\\u5929\\u4e0b', u'\\u7f51\\u7...</td>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> e1e4fcf05470426a5d133a786215fc0f</td>\n",
        "      <td> 2015-01-13</td>\n",
        "      <td> \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...</td>\n",
        "      <td> [u'\\u79d1\\u5b66\\u7f51', u'\\u900f\\u660e', u'\\u8...</td>\n",
        "      <td> 1</td>\n",
        "      <td> 9</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 8,
       "text": [
        "                                uid                               mid  \\\n",
        "0  07fc721342df1a4c1992560b582992f8  f03b783f63a9cda982eaef22286445ad   \n",
        "1  07fc721342df1a4c1992560b582992f8  8d869b3e8dae07ca346a9642665103d2   \n",
        "2  07fc721342df1a4c1992560b582992f8  61dc72d7e1e38aa72d18ffa2c21c98e8   \n",
        "3  07fc721342df1a4c1992560b582992f8  9cc17196a9800b5d76504c9618736d95   \n",
        "4  07fc721342df1a4c1992560b582992f8  e1e4fcf05470426a5d133a786215fc0f   \n",
        "\n",
        "         time                                            context  \\\n",
        "0  2015-01-01                               [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing   \n",
        "1  2015-01-05                                    [doge]fzuer.com   \n",
        "2  2015-01-05  [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...   \n",
        "3  2015-01-08                                \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]   \n",
        "4  2015-01-13  \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...   \n",
        "\n",
        "                                       context_clean  forward_count  \\\n",
        "0  [u'doge', u'\\u9996\\u80dc', u'\\u5df2', u'\\u70e7...              1   \n",
        "1                        [u'doge', u'fzuer', u'com']              1   \n",
        "2  [u'\\u601d\\u8003', u'TX', u'\\u57df\\u540d', u'\\u...              1   \n",
        "3  [u'\\u671d\\u95fb', u'\\u5929\\u4e0b', u'\\u7f51\\u7...              1   \n",
        "4  [u'\\u79d1\\u5b66\\u7f51', u'\\u900f\\u660e', u'\\u8...              1   \n",
        "\n",
        "   comment_count  like_count  \n",
        "0              1           1  \n",
        "1              1           1  \n",
        "2              2           1  \n",
        "3              2           1  \n",
        "4              9           3  "
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.genResult('BOW_LR_2014-12-01_2014-12-31',fw.weibo_predict_data[['uid','mid','forward_count','comment_count','like_count']])"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "def f(a):\n",
      "    print a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 1
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "f(2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "2\n"
       ]
      }
     ],
     "prompt_number": 2
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "f(b=2)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "TypeError",
       "evalue": "f() got an unexpected keyword argument 'b'",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mTypeError\u001b[0m                                 Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-4-837db8e467cc>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mf\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mb\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;36m2\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;31mTypeError\u001b[0m: f() got an unexpected keyword argument 'b'"
       ]
      }
     ],
     "prompt_number": 4
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a=fw.weibo_predict_data.ix[5]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 41
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 47,
       "text": [
        "uid        07fc721342df1a4c1992560b582992f8\n",
        "mid        c82433cf3644199279912be03651185f\n",
        "time                             2015-01-20\n",
        "context                        [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d\n",
        "Name: 5, dtype: object"
       ]
      }
     ],
     "prompt_number": 47
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "def f(**p):\n",
      "    for k,v in p.items():\n",
      "        print p['b'][0]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 29
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "f(**a)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "1\n",
        "1\n"
       ]
      }
     ],
     "prompt_number": 31
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>uid</th>\n",
        "      <th>mid</th>\n",
        "      <th>time</th>\n",
        "      <th>context</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> f03b783f63a9cda982eaef22286445ad</td>\n",
        "      <td> 2015-01-01</td>\n",
        "      <td>                              [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 8d869b3e8dae07ca346a9642665103d2</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td>                                   [doge]fzuer.com</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 61dc72d7e1e38aa72d18ffa2c21c98e8</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td> [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 9cc17196a9800b5d76504c9618736d95</td>\n",
        "      <td> 2015-01-08</td>\n",
        "      <td>                               \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> e1e4fcf05470426a5d133a786215fc0f</td>\n",
        "      <td> 2015-01-13</td>\n",
        "      <td> \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 54,
       "text": [
        "                                uid                               mid  \\\n",
        "0  07fc721342df1a4c1992560b582992f8  f03b783f63a9cda982eaef22286445ad   \n",
        "1  07fc721342df1a4c1992560b582992f8  8d869b3e8dae07ca346a9642665103d2   \n",
        "2  07fc721342df1a4c1992560b582992f8  61dc72d7e1e38aa72d18ffa2c21c98e8   \n",
        "3  07fc721342df1a4c1992560b582992f8  9cc17196a9800b5d76504c9618736d95   \n",
        "4  07fc721342df1a4c1992560b582992f8  e1e4fcf05470426a5d133a786215fc0f   \n",
        "\n",
        "         time                                            context  \n",
        "0  2015-01-01                               [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing  \n",
        "1  2015-01-05                                    [doge]fzuer.com  \n",
        "2  2015-01-05  [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...  \n",
        "3  2015-01-08                                \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]  \n",
        "4  2015-01-13  \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...  "
       ]
      }
     ],
     "prompt_number": 54
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b=fw.weibo_predict_data.head()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 35
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b.add(a,axis='index')"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "ename": "ValueError",
       "evalue": "operands could not be broadcast together with shapes (36) (9) ",
       "output_type": "pyerr",
       "traceback": [
        "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m\n\u001b[0;31mValueError\u001b[0m                                Traceback (most recent call last)",
        "\u001b[0;32m<ipython-input-52-8feb51ebc3a3>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mb\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0madd\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0ma\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;34m'index'\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/core/ops.pyc\u001b[0m in \u001b[0;36mf\u001b[0;34m(self, other, axis, level, fill_value)\u001b[0m\n\u001b[1;32m    761\u001b[0m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_combine_frame\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mna_op\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    762\u001b[0m         \u001b[0;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mpd\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mSeries\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 763\u001b[0;31m             \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_combine_series\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mna_op\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0maxis\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    764\u001b[0m         \u001b[0;32melif\u001b[0m \u001b[0misinstance\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mlist\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtuple\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    765\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0maxis\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0mNone\u001b[0m \u001b[0;32mand\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_axis_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'index'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/core/frame.pyc\u001b[0m in \u001b[0;36m_combine_series\u001b[0;34m(self, other, func, fill_value, axis, level)\u001b[0m\n\u001b[1;32m   2828\u001b[0m             \u001b[0maxis\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_axis_name\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0maxis\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2829\u001b[0m             \u001b[0;32mif\u001b[0m \u001b[0maxis\u001b[0m \u001b[0;34m==\u001b[0m \u001b[0;34m'index'\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2830\u001b[0;31m                 \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_combine_match_index\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mlevel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfill_value\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m   2831\u001b[0m             \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2832\u001b[0m                 \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_combine_match_columns\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mother\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfunc\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mlevel\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mlevel\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mfill_value\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mfill_value\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/core/frame.pyc\u001b[0m in \u001b[0;36m_combine_match_index\u001b[0;34m(self, other, func, level, fill_value)\u001b[0m\n\u001b[1;32m   2858\u001b[0m             raise NotImplementedError(\"fill_value %r not supported.\" %\n\u001b[1;32m   2859\u001b[0m                                       fill_value)\n\u001b[0;32m-> 2860\u001b[0;31m         return self._constructor(func(left.values.T, right.values).T,\n\u001b[0m\u001b[1;32m   2861\u001b[0m                                  \u001b[0mindex\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mleft\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mindex\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m   2862\u001b[0m                                  columns=self.columns, copy=False)\n",
        "\u001b[0;32m/Users/Pro/canopy/lib/python2.7/site-packages/pandas/core/ops.pyc\u001b[0m in \u001b[0;36mna_op\u001b[0;34m(x, y)\u001b[0m\n\u001b[1;32m    737\u001b[0m                 \u001b[0mresult\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mempty\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mx\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0msize\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mdtype\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mdtype\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    738\u001b[0m                 \u001b[0myrav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0my\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mravel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 739\u001b[0;31m                 \u001b[0mmask\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnotnull\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mxrav\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;34m&\u001b[0m \u001b[0mnotnull\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0myrav\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m    740\u001b[0m                 \u001b[0mxrav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mxrav\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mmask\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m    741\u001b[0m                 \u001b[0myrav\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0myrav\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mmask\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
        "\u001b[0;31mValueError\u001b[0m: operands could not be broadcast together with shapes (36) (9) "
       ]
      }
     ],
     "prompt_number": 52
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>uid</th>\n",
        "      <th>mid</th>\n",
        "      <th>time</th>\n",
        "      <th>context</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> f03b783f63a9cda982eaef22286445ad</td>\n",
        "      <td> 2015-01-01</td>\n",
        "      <td>                              [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 8d869b3e8dae07ca346a9642665103d2</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td>                                   [doge]fzuer.com</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 61dc72d7e1e38aa72d18ffa2c21c98e8</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td> [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 9cc17196a9800b5d76504c9618736d95</td>\n",
        "      <td> 2015-01-08</td>\n",
        "      <td>                               \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> e1e4fcf05470426a5d133a786215fc0f</td>\n",
        "      <td> 2015-01-13</td>\n",
        "      <td> \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 55,
       "text": [
        "                                uid                               mid  \\\n",
        "0  07fc721342df1a4c1992560b582992f8  f03b783f63a9cda982eaef22286445ad   \n",
        "1  07fc721342df1a4c1992560b582992f8  8d869b3e8dae07ca346a9642665103d2   \n",
        "2  07fc721342df1a4c1992560b582992f8  61dc72d7e1e38aa72d18ffa2c21c98e8   \n",
        "3  07fc721342df1a4c1992560b582992f8  9cc17196a9800b5d76504c9618736d95   \n",
        "4  07fc721342df1a4c1992560b582992f8  e1e4fcf05470426a5d133a786215fc0f   \n",
        "\n",
        "         time                                            context  \n",
        "0  2015-01-01                               [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing  \n",
        "1  2015-01-05                                    [doge]fzuer.com  \n",
        "2  2015-01-05  [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...  \n",
        "3  2015-01-08                                \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]  \n",
        "4  2015-01-13  \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...  "
       ]
      }
     ],
     "prompt_number": 55
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b.loc[10]=a"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 60
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>uid</th>\n",
        "      <th>mid</th>\n",
        "      <th>time</th>\n",
        "      <th>context</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th> 0 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> f03b783f63a9cda982eaef22286445ad</td>\n",
        "      <td> 2015-01-01</td>\n",
        "      <td>                              [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 1 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 8d869b3e8dae07ca346a9642665103d2</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td>                                   [doge]fzuer.com</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 2 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 61dc72d7e1e38aa72d18ffa2c21c98e8</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td> [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 3 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 9cc17196a9800b5d76504c9618736d95</td>\n",
        "      <td> 2015-01-08</td>\n",
        "      <td>                               \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 4 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> e1e4fcf05470426a5d133a786215fc0f</td>\n",
        "      <td> 2015-01-13</td>\n",
        "      <td> \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 5 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> c82433cf3644199279912be03651185f</td>\n",
        "      <td> 2015-01-20</td>\n",
        "      <td>                                      [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>-1 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> c82433cf3644199279912be03651185f</td>\n",
        "      <td> 2015-01-20</td>\n",
        "      <td>                                      [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 10</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> c82433cf3644199279912be03651185f</td>\n",
        "      <td> 2015-01-20</td>\n",
        "      <td>                                      [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 61,
       "text": [
        "                                  uid                               mid  \\\n",
        " 0   07fc721342df1a4c1992560b582992f8  f03b783f63a9cda982eaef22286445ad   \n",
        " 1   07fc721342df1a4c1992560b582992f8  8d869b3e8dae07ca346a9642665103d2   \n",
        " 2   07fc721342df1a4c1992560b582992f8  61dc72d7e1e38aa72d18ffa2c21c98e8   \n",
        " 3   07fc721342df1a4c1992560b582992f8  9cc17196a9800b5d76504c9618736d95   \n",
        " 4   07fc721342df1a4c1992560b582992f8  e1e4fcf05470426a5d133a786215fc0f   \n",
        " 5   07fc721342df1a4c1992560b582992f8  c82433cf3644199279912be03651185f   \n",
        "-1   07fc721342df1a4c1992560b582992f8  c82433cf3644199279912be03651185f   \n",
        " 10  07fc721342df1a4c1992560b582992f8  c82433cf3644199279912be03651185f   \n",
        "\n",
        "           time                                            context  \n",
        " 0   2015-01-01                               [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing  \n",
        " 1   2015-01-05                                    [doge]fzuer.com  \n",
        " 2   2015-01-05  [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...  \n",
        " 3   2015-01-08                                \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]  \n",
        " 4   2015-01-13  \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...  \n",
        " 5   2015-01-20                                       [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d  \n",
        "-1   2015-01-20                                       [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d  \n",
        " 10  2015-01-20                                       [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d  "
       ]
      }
     ],
     "prompt_number": 61
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "len(b)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 62,
       "text": [
        "8"
       ]
      }
     ],
     "prompt_number": 62
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b.loc[11]=[1,2,3,{'c':1}]"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 65
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>uid</th>\n",
        "      <th>mid</th>\n",
        "      <th>time</th>\n",
        "      <th>context</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th> 0 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> f03b783f63a9cda982eaef22286445ad</td>\n",
        "      <td> 2015-01-01</td>\n",
        "      <td>                              [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 1 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 8d869b3e8dae07ca346a9642665103d2</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td>                                   [doge]fzuer.com</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 2 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 61dc72d7e1e38aa72d18ffa2c21c98e8</td>\n",
        "      <td> 2015-01-05</td>\n",
        "      <td> [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 3 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> 9cc17196a9800b5d76504c9618736d95</td>\n",
        "      <td> 2015-01-08</td>\n",
        "      <td>                               \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 4 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> e1e4fcf05470426a5d133a786215fc0f</td>\n",
        "      <td> 2015-01-13</td>\n",
        "      <td> \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 5 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> c82433cf3644199279912be03651185f</td>\n",
        "      <td> 2015-01-20</td>\n",
        "      <td>                                      [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>-1 </th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> c82433cf3644199279912be03651185f</td>\n",
        "      <td> 2015-01-20</td>\n",
        "      <td>                                      [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 10</th>\n",
        "      <td> 07fc721342df1a4c1992560b582992f8</td>\n",
        "      <td> c82433cf3644199279912be03651185f</td>\n",
        "      <td> 2015-01-20</td>\n",
        "      <td>                                      [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th> 11</th>\n",
        "      <td>                                1</td>\n",
        "      <td>                                2</td>\n",
        "      <td>          3</td>\n",
        "      <td>                                         {u'c': 1}</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 66,
       "text": [
        "                                  uid                               mid  \\\n",
        " 0   07fc721342df1a4c1992560b582992f8  f03b783f63a9cda982eaef22286445ad   \n",
        " 1   07fc721342df1a4c1992560b582992f8  8d869b3e8dae07ca346a9642665103d2   \n",
        " 2   07fc721342df1a4c1992560b582992f8  61dc72d7e1e38aa72d18ffa2c21c98e8   \n",
        " 3   07fc721342df1a4c1992560b582992f8  9cc17196a9800b5d76504c9618736d95   \n",
        " 4   07fc721342df1a4c1992560b582992f8  e1e4fcf05470426a5d133a786215fc0f   \n",
        " 5   07fc721342df1a4c1992560b582992f8  c82433cf3644199279912be03651185f   \n",
        "-1   07fc721342df1a4c1992560b582992f8  c82433cf3644199279912be03651185f   \n",
        " 10  07fc721342df1a4c1992560b582992f8  c82433cf3644199279912be03651185f   \n",
        " 11                                 1                                 2   \n",
        "\n",
        "           time                                            context  \n",
        " 0   2015-01-01                               [doge]2015\u9996\u80dc\u5df2\u62ff\uff0c\u70e7\u70e4ing  \n",
        " 1   2015-01-05                                    [doge]fzuer.com  \n",
        " 2   2015-01-05  [\u601d\u8003]TX\u57df\u540d\u90ae\u7bb1\u5c45\u7136\u6ca1\u6709\u57df\u540d\u6240\u6709\u6743\u91cd\u65b0\u9a8c\u8bc1\u9009\u9879\uff1f\u65b0\u6ce8\u518c\u4e00\u4e2a\u57df\u540d\u53bb\u6ce8\u518c\u4f60\u4eec\u7684\u57df\u540d\u90ae\u7bb1\uff0c\u663e\u793a...  \n",
        " 3   2015-01-08                                \u671d\u95fb\u5929\u4e0b\uff1a\u7f51\u7edc\u90e8\u961f\u54ea\u5bb6\u5f3a\uff1f[doge]  \n",
        " 4   2015-01-13  \u79d1\u5b66\u7f51\u2014\u7ed9\u201c\u900f\u660e\u8ba1\u7b97\u201d\u6cfc\u4e2a\u51b7\u6c34 - \u5218\u6d0b\u7684\u535a\u6587 \u201c\u900f\u660e\u8ba1\u7b97\u201d\u83b7\u5f97\u4e862014\u5e74\u5ea6\u56fd\u5bb6\u81ea\u7136\u79d1\u5b66\u5956...  \n",
        " 5   2015-01-20                                       [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d  \n",
        "-1   2015-01-20                                       [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d  \n",
        " 10  2015-01-20                                       [\u9634\u9669]\u562d\u256e(\u256f\u25bd\u2570)\u256d  \n",
        " 11           3                                          {u'c': 1}  "
       ]
      }
     ],
     "prompt_number": 66
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "b.ix[11].context['c']"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 70,
       "text": [
        "1"
       ]
      }
     ],
     "prompt_number": 70
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.BOW(vec_time=['2014-08-01','2014-12-31'],max_features=100,fit=True)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loading data...\n",
        "fitting and transforming..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "saving models..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "saving features..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>BOW_1</th>\n",
        "      <th>BOW_2</th>\n",
        "      <th>BOW_3</th>\n",
        "      <th>BOW_4</th>\n",
        "      <th>BOW_5</th>\n",
        "      <th>BOW_6</th>\n",
        "      <th>BOW_7</th>\n",
        "      <th>BOW_8</th>\n",
        "      <th>BOW_9</th>\n",
        "      <th>BOW_10</th>\n",
        "      <th>...</th>\n",
        "      <th>BOW_91</th>\n",
        "      <th>BOW_92</th>\n",
        "      <th>BOW_93</th>\n",
        "      <th>BOW_94</th>\n",
        "      <th>BOW_95</th>\n",
        "      <th>BOW_96</th>\n",
        "      <th>BOW_97</th>\n",
        "      <th>BOW_98</th>\n",
        "      <th>BOW_99</th>\n",
        "      <th>BOW_100</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9      </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>21     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>22     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>23     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>24     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>25     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>26     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>27     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>28     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>29     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>...</th>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347401</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347402</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347403</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347404</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347405</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347406</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347407</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347408</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347409</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347410</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347411</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347412</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347413</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347414</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347415</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347416</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347417</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347418</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 3</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347419</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347420</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347421</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347422</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347423</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347424</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347425</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347426</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347427</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347428</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347429</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1347430</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>1347431 rows \u00d7 100 columns</p>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 5,
       "text": [
        "         BOW_1  BOW_2  BOW_3  BOW_4  BOW_5  BOW_6  BOW_7  BOW_8  BOW_9  \\\n",
        "0            0      0      0      0      1      0      0      0      0   \n",
        "1            0      0      0      0      0      0      0      0      0   \n",
        "2            0      0      0      0      0      0      0      0      0   \n",
        "3            0      0      0      0      0      0      0      0      0   \n",
        "4            0      0      0      0      0      0      0      0      0   \n",
        "5            0      0      0      0      0      0      0      0      0   \n",
        "6            0      0      0      0      0      0      0      0      0   \n",
        "7            0      0      0      0      0      0      0      0      0   \n",
        "8            0      0      0      0      0      0      0      0      0   \n",
        "9            0      0      0      0      0      0      0      1      0   \n",
        "10           0      0      0      0      0      0      0      0      0   \n",
        "11           0      0      0      0      0      0      0      0      0   \n",
        "12           0      0      0      0      0      0      0      0      0   \n",
        "13           0      0      0      0      0      0      0      0      0   \n",
        "14           0      0      0      0      0      0      0      0      0   \n",
        "15           0      0      0      0      0      0      0      0      0   \n",
        "16           0      0      0      0      0      0      0      0      0   \n",
        "17           0      0      0      0      0      0      0      0      0   \n",
        "18           0      0      0      0      0      0      0      0      0   \n",
        "19           0      0      0      0      0      0      0      0      0   \n",
        "20           0      0      0      0      0      0      0      0      0   \n",
        "21           0      0      0      0      0      0      0      0      0   \n",
        "22           0      0      0      0      0      0      0      0      0   \n",
        "23           0      0      0      0      0      0      0      0      0   \n",
        "24           0      0      0      0      0      0      0      0      0   \n",
        "25           0      0      0      0      0      0      0      0      0   \n",
        "26           0      0      0      0      0      0      0      0      0   \n",
        "27           0      0      0      0      0      0      0      0      0   \n",
        "28           0      0      0      0      0      0      0      0      0   \n",
        "29           0      0      0      0      0      0      0      0      0   \n",
        "...        ...    ...    ...    ...    ...    ...    ...    ...    ...   \n",
        "1347401      0      0      0      0      0      0      0      0      0   \n",
        "1347402      0      0      0      0      0      0      0      0      0   \n",
        "1347403      0      0      0      0      0      0      0      0      0   \n",
        "1347404      0      0      0      0      0      0      0      0      0   \n",
        "1347405      0      0      0      0      0      0      0      0      0   \n",
        "1347406      0      0      0      0      0      0      0      0      0   \n",
        "1347407      0      0      0      0      0      0      0      0      0   \n",
        "1347408      0      0      0      0      0      0      0      0      0   \n",
        "1347409      0      0      0      0      1      0      0      0      0   \n",
        "1347410      0      0      0      0      0      0      0      0      0   \n",
        "1347411      0      0      0      0      0      0      0      0      0   \n",
        "1347412      0      0      0      0      0      0      0      0      0   \n",
        "1347413      0      0      0      0      0      0      0      0      0   \n",
        "1347414      0      0      0      0      0      0      0      0      0   \n",
        "1347415      0      0      0      0      0      0      0      0      0   \n",
        "1347416      0      0      0      0      0      0      0      0      0   \n",
        "1347417      0      0      0      0      0      0      0      0      0   \n",
        "1347418      0      0      0      0      0      0      0      3      0   \n",
        "1347419      0      0      0      0      0      0      0      0      0   \n",
        "1347420      0      0      0      0      0      0      0      0      0   \n",
        "1347421      0      0      0      0      0      0      0      0      0   \n",
        "1347422      0      0      0      0      0      0      0      0      0   \n",
        "1347423      0      0      0      0      0      0      0      1      0   \n",
        "1347424      0      0      0      0      0      0      0      0      0   \n",
        "1347425      1      0      0      0      0      0      0      0      1   \n",
        "1347426      0      0      0      0      0      0      0      0      0   \n",
        "1347427      0      0      0      0      1      0      0      0      0   \n",
        "1347428      0      0      0      0      0      0      0      0      0   \n",
        "1347429      0      0      0      0      0      0      0      0      0   \n",
        "1347430      0      0      0      0      0      0      0      0      0   \n",
        "\n",
        "         BOW_10   ...    BOW_91  BOW_92  BOW_93  BOW_94  BOW_95  BOW_96  \\\n",
        "0             0   ...         0       0       0       0       0       0   \n",
        "1             0   ...         0       0       0       0       0       0   \n",
        "2             0   ...         0       0       0       0       0       0   \n",
        "3             0   ...         0       0       0       0       0       0   \n",
        "4             0   ...         0       0       0       0       0       0   \n",
        "5             0   ...         0       0       0       0       0       0   \n",
        "6             0   ...         0       0       0       0       0       0   \n",
        "7             0   ...         0       0       0       0       0       0   \n",
        "8             0   ...         0       0       0       0       0       0   \n",
        "9             0   ...         0       0       0       0       0       0   \n",
        "10            0   ...         0       1       0       0       0       0   \n",
        "11            1   ...         0       0       0       0       0       0   \n",
        "12            0   ...         0       0       0       0       0       0   \n",
        "13            0   ...         0       0       0       0       0       0   \n",
        "14            0   ...         0       0       0       0       0       0   \n",
        "15            0   ...         0       0       0       0       0       0   \n",
        "16            0   ...         0       0       0       0       0       0   \n",
        "17            0   ...         0       0       0       0       0       0   \n",
        "18            0   ...         0       0       0       0       0       0   \n",
        "19            0   ...         0       0       0       0       0       0   \n",
        "20            0   ...         0       0       0       0       0       0   \n",
        "21            0   ...         0       0       0       0       0       0   \n",
        "22            0   ...         0       0       0       0       0       0   \n",
        "23            0   ...         0       0       0       0       0       0   \n",
        "24            0   ...         0       0       0       0       0       0   \n",
        "25            0   ...         0       0       0       0       0       0   \n",
        "26            0   ...         0       0       0       0       0       0   \n",
        "27            0   ...         0       0       0       0       0       0   \n",
        "28            0   ...         0       0       0       0       0       0   \n",
        "29            0   ...         0       0       0       0       0       0   \n",
        "...         ...   ...       ...     ...     ...     ...     ...     ...   \n",
        "1347401       0   ...         0       0       0       0       0       0   \n",
        "1347402       0   ...         0       0       0       0       0       0   \n",
        "1347403       0   ...         0       0       0       0       0       0   \n",
        "1347404       0   ...         0       0       0       0       0       0   \n",
        "1347405       0   ...         0       0       0       0       0       0   \n",
        "1347406       0   ...         0       0       0       0       0       0   \n",
        "1347407       0   ...         0       0       0       0       0       0   \n",
        "1347408       0   ...         0       0       0       0       0       0   \n",
        "1347409       0   ...         0       0       0       0       0       0   \n",
        "1347410       0   ...         0       0       0       0       0       0   \n",
        "1347411       0   ...         0       0       0       0       0       0   \n",
        "1347412       0   ...         0       0       0       0       0       0   \n",
        "1347413       0   ...         0       0       0       0       0       0   \n",
        "1347414       0   ...         0       0       0       0       0       0   \n",
        "1347415       0   ...         0       0       1       0       0       0   \n",
        "1347416       0   ...         0       0       0       0       0       0   \n",
        "1347417       0   ...         0       0       0       0       0       0   \n",
        "1347418       0   ...         0       0       0       0       0       0   \n",
        "1347419       0   ...         0       0       0       0       0       0   \n",
        "1347420       0   ...         0       0       0       0       0       0   \n",
        "1347421       0   ...         0       0       0       0       0       0   \n",
        "1347422       0   ...         0       0       0       0       0       0   \n",
        "1347423       0   ...         0       0       0       0       0       0   \n",
        "1347424       0   ...         0       0       0       0       0       0   \n",
        "1347425       0   ...         0       1       0       0       0       0   \n",
        "1347426       0   ...         0       0       0       0       0       0   \n",
        "1347427       0   ...         0       0       0       0       0       0   \n",
        "1347428       0   ...         0       0       0       0       0       0   \n",
        "1347429       0   ...         0       0       0       0       0       0   \n",
        "1347430       0   ...         0       0       0       0       0       0   \n",
        "\n",
        "         BOW_97  BOW_98  BOW_99  BOW_100  \n",
        "0             1       0       0        0  \n",
        "1             0       0       0        0  \n",
        "2             0       0       0        0  \n",
        "3             0       0       0        0  \n",
        "4             0       0       0        0  \n",
        "5             0       0       0        0  \n",
        "6             0       0       0        0  \n",
        "7             0       0       0        0  \n",
        "8             0       0       0        0  \n",
        "9             0       0       0        0  \n",
        "10            0       0       0        0  \n",
        "11            0       0       0        0  \n",
        "12            0       0       0        0  \n",
        "13            0       0       0        0  \n",
        "14            0       0       0        0  \n",
        "15            0       0       0        0  \n",
        "16            0       0       0        0  \n",
        "17            0       0       0        0  \n",
        "18            0       0       0        0  \n",
        "19            0       0       0        0  \n",
        "20            0       0       0        0  \n",
        "21            0       0       0        0  \n",
        "22            0       0       0        0  \n",
        "23            0       0       0        0  \n",
        "24            0       0       0        0  \n",
        "25            0       0       0        0  \n",
        "26            0       0       0        0  \n",
        "27            0       0       0        0  \n",
        "28            0       0       0        0  \n",
        "29            0       0       0        0  \n",
        "...         ...     ...     ...      ...  \n",
        "1347401       0       0       0        0  \n",
        "1347402       0       0       0        0  \n",
        "1347403       0       0       0        0  \n",
        "1347404       0       0       0        0  \n",
        "1347405       0       0       0        0  \n",
        "1347406       0       0       0        0  \n",
        "1347407       0       0       0        0  \n",
        "1347408       0       0       0        0  \n",
        "1347409       0       0       0        0  \n",
        "1347410       0       0       0        0  \n",
        "1347411       0       0       0        0  \n",
        "1347412       0       0       0        0  \n",
        "1347413       0       0       0        0  \n",
        "1347414       0       0       0        0  \n",
        "1347415       0       0       0        0  \n",
        "1347416       0       0       0        0  \n",
        "1347417       0       0       0        0  \n",
        "1347418       0       0       0        0  \n",
        "1347419       0       0       0        0  \n",
        "1347420       0       0       0        0  \n",
        "1347421       0       0       0        0  \n",
        "1347422       0       0       0        0  \n",
        "1347423       0       0       0        0  \n",
        "1347424       0       0       0        0  \n",
        "1347425       0       0       0        0  \n",
        "1347426       0       0       0        0  \n",
        "1347427       0       0       0        0  \n",
        "1347428       0       0       0        0  \n",
        "1347429       0       0       0        0  \n",
        "1347430       0       0       0        0  \n",
        "\n",
        "[1347431 rows x 100 columns]"
       ]
      }
     ],
     "prompt_number": 5
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "from sklearn.externals import joblib\n",
      "f_model = joblib.load(\"../others/2014-07-01_2014-11-30_100.vectorizer\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 56
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.BOW(data_time=['2015-01-01','2015-01-31'],vec_time=['2014-08-01','2014-12-31'],max_features=100)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loading data...\n",
        "transforming..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "saving features..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n"
       ]
      },
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>BOW_1</th>\n",
        "      <th>BOW_2</th>\n",
        "      <th>BOW_3</th>\n",
        "      <th>BOW_4</th>\n",
        "      <th>BOW_5</th>\n",
        "      <th>BOW_6</th>\n",
        "      <th>BOW_7</th>\n",
        "      <th>BOW_8</th>\n",
        "      <th>BOW_9</th>\n",
        "      <th>BOW_10</th>\n",
        "      <th>...</th>\n",
        "      <th>BOW_91</th>\n",
        "      <th>BOW_92</th>\n",
        "      <th>BOW_93</th>\n",
        "      <th>BOW_94</th>\n",
        "      <th>BOW_95</th>\n",
        "      <th>BOW_96</th>\n",
        "      <th>BOW_97</th>\n",
        "      <th>BOW_98</th>\n",
        "      <th>BOW_99</th>\n",
        "      <th>BOW_100</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9     </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>21    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>22    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>23    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>24    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>25    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>26    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>27    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>28    </th>\n",
        "      <td> 3</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>29    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>...</th>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275301</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275302</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275303</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275304</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275305</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275306</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275307</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275308</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275309</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275310</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275311</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275312</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275313</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275314</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275315</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275316</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275317</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275318</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275319</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275320</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275321</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275322</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275323</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275324</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275325</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275326</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275327</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275328</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275329</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275330</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td>...</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>275331 rows \u00d7 100 columns</p>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 8,
       "text": [
        "        BOW_1  BOW_2  BOW_3  BOW_4  BOW_5  BOW_6  BOW_7  BOW_8  BOW_9  BOW_10  \\\n",
        "0           0      0      0      0      0      0      0      0      0       0   \n",
        "1           0      0      0      0      0      0      0      0      0       0   \n",
        "2           0      0      0      0      1      0      0      0      0       0   \n",
        "3           0      0      0      0      0      0      0      0      0       0   \n",
        "4           0      0      0      0      0      0      0      0      0       0   \n",
        "5           0      0      0      0      0      0      0      0      0       0   \n",
        "6           0      0      0      0      0      0      0      0      0       0   \n",
        "7           0      0      0      0      0      0      0      0      0       0   \n",
        "8           0      0      0      0      0      0      0      1      0       0   \n",
        "9           0      0      0      0      0      0      0      0      0       0   \n",
        "10          0      0      0      0      0      0      0      0      0       0   \n",
        "11          0      0      0      0      0      0      0      0      0       0   \n",
        "12          0      0      0      0      0      0      0      0      0       0   \n",
        "13          0      0      0      0      0      0      0      0      0       0   \n",
        "14          0      0      0      0      0      0      0      0      0       0   \n",
        "15          0      0      0      0      0      0      0      0      0       0   \n",
        "16          0      0      0      0      0      0      0      0      0       0   \n",
        "17          0      0      0      0      0      0      0      0      0       0   \n",
        "18          0      0      0      0      0      0      0      0      0       0   \n",
        "19          0      1      0      0      0      0      0      0      0       0   \n",
        "20          0      0      0      0      0      0      0      1      0       0   \n",
        "21          0      0      0      0      0      0      0      1      0       0   \n",
        "22          0      0      0      0      0      0      0      0      1       0   \n",
        "23          0      0      0      0      0      0      0      0      0       0   \n",
        "24          0      0      0      0      0      0      0      0      0       0   \n",
        "25          0      0      0      0      0      0      0      0      0       0   \n",
        "26          0      0      0      0      0      0      0      0      0       0   \n",
        "27          0      0      0      0      0      0      0      0      0       0   \n",
        "28          3      0      0      0      0      2      0      0      0       0   \n",
        "29          0      0      0      0      0      0      0      0      0       0   \n",
        "...       ...    ...    ...    ...    ...    ...    ...    ...    ...     ...   \n",
        "275301      0      0      0      0      0      0      0      0      0       0   \n",
        "275302      0      0      0      0      0      0      2      0      0       0   \n",
        "275303      0      0      0      0      0      0      0      0      0       0   \n",
        "275304      0      0      0      0      0      0      0      0      0       0   \n",
        "275305      0      0      0      0      0      0      0      0      0       0   \n",
        "275306      0      0      0      0      0      0      0      0      0       0   \n",
        "275307      0      0      0      0      0      0      0      0      0       0   \n",
        "275308      0      0      0      0      0      1      0      0      0       0   \n",
        "275309      0      0      0      0      0      0      0      0      0       0   \n",
        "275310      0      0      0      0      0      1      0      0      0       0   \n",
        "275311      0      0      0      0      0      0      0      0      0       0   \n",
        "275312      0      0      0      0      0      0      0      0      0       0   \n",
        "275313      0      0      0      0      0      0      0      0      0       0   \n",
        "275314      0      0      0      0      1      0      0      0      0       0   \n",
        "275315      0      0      0      0      0      0      0      0      0       0   \n",
        "275316      0      0      0      0      0      0      0      0      0       0   \n",
        "275317      0      0      0      0      0      0      0      0      0       0   \n",
        "275318      0      0      0      0      0      0      0      0      0       0   \n",
        "275319      0      0      0      0      0      0      0      0      0       0   \n",
        "275320      0      0      0      0      0      0      0      0      0       0   \n",
        "275321      0      0      0      0      1      0      0      0      0       0   \n",
        "275322      0      0      0      0      0      0      0      0      0       0   \n",
        "275323      0      0      0      0      0      0      0      0      0       0   \n",
        "275324      0      0      0      0      0      0      0      0      0       0   \n",
        "275325      0      0      0      0      0      0      0      0      0       0   \n",
        "275326      0      0      0      0      2      0      0      0      0       0   \n",
        "275327      0      0      0      0      0      0      0      0      0       0   \n",
        "275328      0      0      0      0      0      0      0      0      0       0   \n",
        "275329      0      0      0      0      0      0      0      0      0       0   \n",
        "275330      0      0      0      0      0      0      0      0      0       0   \n",
        "\n",
        "         ...    BOW_91  BOW_92  BOW_93  BOW_94  BOW_95  BOW_96  BOW_97  \\\n",
        "0        ...         0       0       0       0       0       0       0   \n",
        "1        ...         0       0       0       0       0       0       0   \n",
        "2        ...         0       0       0       0       0       0       0   \n",
        "3        ...         0       0       0       0       0       0       0   \n",
        "4        ...         0       0       0       0       0       0       0   \n",
        "5        ...         0       0       0       0       0       0       0   \n",
        "6        ...         0       0       0       0       0       0       0   \n",
        "7        ...         0       0       0       0       0       0       0   \n",
        "8        ...         0       0       0       0       0       0       0   \n",
        "9        ...         0       0       0       0       0       0       0   \n",
        "10       ...         0       0       0       0       0       0       0   \n",
        "11       ...         0       0       0       0       0       0       0   \n",
        "12       ...         0       0       0       0       0       0       0   \n",
        "13       ...         0       0       0       0       0       0       0   \n",
        "14       ...         0       0       0       0       0       0       0   \n",
        "15       ...         0       0       0       0       0       0       0   \n",
        "16       ...         0       0       0       0       0       0       0   \n",
        "17       ...         0       0       0       0       0       0       0   \n",
        "18       ...         0       1       0       0       0       0       0   \n",
        "19       ...         0       0       0       0       0       0       0   \n",
        "20       ...         0       0       0       0       0       0       0   \n",
        "21       ...         0       0       0       0       0       0       0   \n",
        "22       ...         0       0       0       0       0       0       0   \n",
        "23       ...         0       0       0       0       0       0       0   \n",
        "24       ...         0       0       0       0       0       0       0   \n",
        "25       ...         0       0       0       0       0       0       0   \n",
        "26       ...         0       0       0       0       0       0       0   \n",
        "27       ...         0       0       0       0       0       0       0   \n",
        "28       ...         0       0       0       0       0       0       0   \n",
        "29       ...         0       0       0       0       0       0       0   \n",
        "...      ...       ...     ...     ...     ...     ...     ...     ...   \n",
        "275301   ...         0       0       0       0       0       0       0   \n",
        "275302   ...         0       0       0       0       0       0       0   \n",
        "275303   ...         0       0       0       0       0       0       0   \n",
        "275304   ...         0       0       0       0       0       0       0   \n",
        "275305   ...         0       0       0       0       0       0       0   \n",
        "275306   ...         0       0       0       0       0       0       0   \n",
        "275307   ...         0       0       0       0       0       0       0   \n",
        "275308   ...         0       0       0       0       0       0       0   \n",
        "275309   ...         0       0       0       0       0       0       0   \n",
        "275310   ...         0       0       0       0       0       0       0   \n",
        "275311   ...         0       0       0       0       0       0       0   \n",
        "275312   ...         0       0       0       0       0       0       0   \n",
        "275313   ...         0       0       0       0       0       0       0   \n",
        "275314   ...         0       0       0       0       0       0       0   \n",
        "275315   ...         0       0       0       0       0       0       0   \n",
        "275316   ...         0       0       0       0       0       0       0   \n",
        "275317   ...         0       0       0       0       0       0       0   \n",
        "275318   ...         0       0       0       0       0       0       0   \n",
        "275319   ...         0       0       0       0       0       0       0   \n",
        "275320   ...         0       0       0       0       0       0       0   \n",
        "275321   ...         0       0       0       0       0       0       0   \n",
        "275322   ...         0       1       0       0       0       0       0   \n",
        "275323   ...         0       0       0       0       0       0       0   \n",
        "275324   ...         0       1       0       0       0       0       0   \n",
        "275325   ...         0       0       0       0       0       0       0   \n",
        "275326   ...         0       0       0       0       0       0       0   \n",
        "275327   ...         0       0       0       0       0       0       0   \n",
        "275328   ...         0       0       0       0       0       0       0   \n",
        "275329   ...         0       0       0       0       0       0       0   \n",
        "275330   ...         0       0       0       0       0       0       0   \n",
        "\n",
        "        BOW_98  BOW_99  BOW_100  \n",
        "0            0       0        0  \n",
        "1            0       0        0  \n",
        "2            0       0        0  \n",
        "3            0       0        0  \n",
        "4            0       0        0  \n",
        "5            0       0        0  \n",
        "6            0       0        0  \n",
        "7            0       0        0  \n",
        "8            0       0        0  \n",
        "9            0       0        0  \n",
        "10           0       0        0  \n",
        "11           0       0        0  \n",
        "12           0       0        0  \n",
        "13           0       0        0  \n",
        "14           0       0        0  \n",
        "15           0       0        0  \n",
        "16           0       0        0  \n",
        "17           0       0        0  \n",
        "18           0       0        0  \n",
        "19           0       0        2  \n",
        "20           0       0        0  \n",
        "21           0       0        0  \n",
        "22           0       0        0  \n",
        "23           0       0        0  \n",
        "24           0       0        0  \n",
        "25           0       0        0  \n",
        "26           0       0        0  \n",
        "27           0       0        0  \n",
        "28           0       0        0  \n",
        "29           1       0        0  \n",
        "...        ...     ...      ...  \n",
        "275301       0       0        0  \n",
        "275302       0       0        0  \n",
        "275303       0       0        0  \n",
        "275304       0       0        0  \n",
        "275305       0       0        0  \n",
        "275306       0       0        0  \n",
        "275307       0       0        0  \n",
        "275308       0       0        0  \n",
        "275309       0       0        0  \n",
        "275310       0       0        0  \n",
        "275311       0       0        0  \n",
        "275312       0       0        0  \n",
        "275313       0       0        0  \n",
        "275314       0       0        0  \n",
        "275315       0       0        0  \n",
        "275316       0       0        0  \n",
        "275317       0       0        0  \n",
        "275318       0       0        0  \n",
        "275319       0       0        0  \n",
        "275320       0       0        0  \n",
        "275321       0       0        0  \n",
        "275322       0       0        0  \n",
        "275323       0       0        0  \n",
        "275324       0       0        0  \n",
        "275325       0       0        0  \n",
        "275326       0       0        0  \n",
        "275327       0       0        0  \n",
        "275328       0       0        0  \n",
        "275329       0       0        0  \n",
        "275330       0       0        0  \n",
        "\n",
        "[275331 rows x 100 columns]"
       ]
      }
     ],
     "prompt_number": 8
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "import weiboPredict"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 25
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "reload(weiboPredict.framework)\n",
      "fw.loadData()"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [],
     "prompt_number": 51
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.features_log"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>feature_name</th>\n",
        "      <th>feature_type</th>\n",
        "      <th>data_time</th>\n",
        "      <th>parameters</th>\n",
        "      <th>category</th>\n",
        "      <th>feature_address</th>\n",
        "      <th>description</th>\n",
        "      <th>feature_shape</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-07-01, 2014-11-30]</td>\n",
        "      <td> {u'max_features': 100, u'vec_time': [u'2014-07...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-07-01_2014-11-30_2014-07-...</td>\n",
        "      <td> Bag of Words in word count from 2014-07-01 to ...</td>\n",
        "      <td> [1354048, 100]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-12-01, 2014-12-31]</td>\n",
        "      <td> {u'max_features': 100, u'vec_time': [u'2014-07...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-12-01_2014-12-31_2014-07-...</td>\n",
        "      <td> Bag of Words in word count from 2014-12-01 to ...</td>\n",
        "      <td>  [272702, 100]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-07-01, 2014-11-30]</td>\n",
        "      <td> {u'max_features': 50, u'vec_time': [u'2014-07-...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-07-01_2014-11-30_2014-07-...</td>\n",
        "      <td> Bag of Words in word count from 2014-07-01 to ...</td>\n",
        "      <td>  [1354048, 50]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3</th>\n",
        "      <td> BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-12-01, 2014-12-31]</td>\n",
        "      <td> {u'max_features': 50, u'vec_time': [u'2014-07-...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-12-01_2014-12-31_2014-07-...</td>\n",
        "      <td> Bag of Words in word count from 2014-12-01 to ...</td>\n",
        "      <td>   [272702, 50]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4</th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-07-01, 2014-11-30]</td>\n",
        "      <td> {u'max_features': 30, u'vec_time': [u'2014-07-...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-07-01_2014-11-30_2014-07-...</td>\n",
        "      <td> Bag of Words in word count from 2014-07-01 to ...</td>\n",
        "      <td>  [1354048, 30]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5</th>\n",
        "      <td> BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-12-01, 2014-12-31]</td>\n",
        "      <td> {u'max_features': 30, u'vec_time': [u'2014-07-...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-12-01_2014-12-31_2014-07-...</td>\n",
        "      <td> Bag of Words in word count from 2014-12-01 to ...</td>\n",
        "      <td>   [272702, 30]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6</th>\n",
        "      <td> BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2014-08-01, 2014-12-31]</td>\n",
        "      <td> {u'max_features': 100, u'vec_time': [u'2014-08...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2014-08-01_2014-12-31_2014-08-...</td>\n",
        "      <td> Bag of Words in word count from 2014-08-01 to ...</td>\n",
        "      <td> [1347431, 100]</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7</th>\n",
        "      <td> BOW_2015-01-01_2015-01-31_2014-08-01_2014-12-3...</td>\n",
        "      <td> BOW</td>\n",
        "      <td> [2015-01-01, 2015-01-31]</td>\n",
        "      <td> {u'max_features': 100, u'vec_time': [u'2014-08...</td>\n",
        "      <td> I</td>\n",
        "      <td> ../features/BOW_2015-01-01_2015-01-31_2014-08-...</td>\n",
        "      <td> Bag of Words in word count from 2015-01-01 to ...</td>\n",
        "      <td>  [275331, 100]</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 9,
       "text": [
        "                                        feature_name feature_type  \\\n",
        "0  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...          BOW   \n",
        "1  BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...          BOW   \n",
        "2  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...          BOW   \n",
        "3  BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...          BOW   \n",
        "4  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...          BOW   \n",
        "5  BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...          BOW   \n",
        "6  BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...          BOW   \n",
        "7  BOW_2015-01-01_2015-01-31_2014-08-01_2014-12-3...          BOW   \n",
        "\n",
        "                  data_time  \\\n",
        "0  [2014-07-01, 2014-11-30]   \n",
        "1  [2014-12-01, 2014-12-31]   \n",
        "2  [2014-07-01, 2014-11-30]   \n",
        "3  [2014-12-01, 2014-12-31]   \n",
        "4  [2014-07-01, 2014-11-30]   \n",
        "5  [2014-12-01, 2014-12-31]   \n",
        "6  [2014-08-01, 2014-12-31]   \n",
        "7  [2015-01-01, 2015-01-31]   \n",
        "\n",
        "                                          parameters category  \\\n",
        "0  {u'max_features': 100, u'vec_time': [u'2014-07...        I   \n",
        "1  {u'max_features': 100, u'vec_time': [u'2014-07...        I   \n",
        "2  {u'max_features': 50, u'vec_time': [u'2014-07-...        I   \n",
        "3  {u'max_features': 50, u'vec_time': [u'2014-07-...        I   \n",
        "4  {u'max_features': 30, u'vec_time': [u'2014-07-...        I   \n",
        "5  {u'max_features': 30, u'vec_time': [u'2014-07-...        I   \n",
        "6  {u'max_features': 100, u'vec_time': [u'2014-08...        I   \n",
        "7  {u'max_features': 100, u'vec_time': [u'2014-08...        I   \n",
        "\n",
        "                                     feature_address  \\\n",
        "0  ../features/BOW_2014-07-01_2014-11-30_2014-07-...   \n",
        "1  ../features/BOW_2014-12-01_2014-12-31_2014-07-...   \n",
        "2  ../features/BOW_2014-07-01_2014-11-30_2014-07-...   \n",
        "3  ../features/BOW_2014-12-01_2014-12-31_2014-07-...   \n",
        "4  ../features/BOW_2014-07-01_2014-11-30_2014-07-...   \n",
        "5  ../features/BOW_2014-12-01_2014-12-31_2014-07-...   \n",
        "6  ../features/BOW_2014-08-01_2014-12-31_2014-08-...   \n",
        "7  ../features/BOW_2015-01-01_2015-01-31_2014-08-...   \n",
        "\n",
        "                                         description   feature_shape  \n",
        "0  Bag of Words in word count from 2014-07-01 to ...  [1354048, 100]  \n",
        "1  Bag of Words in word count from 2014-12-01 to ...   [272702, 100]  \n",
        "2  Bag of Words in word count from 2014-07-01 to ...   [1354048, 50]  \n",
        "3  Bag of Words in word count from 2014-12-01 to ...    [272702, 50]  \n",
        "4  Bag of Words in word count from 2014-07-01 to ...   [1354048, 30]  \n",
        "5  Bag of Words in word count from 2014-12-01 to ...    [272702, 30]  \n",
        "6  Bag of Words in word count from 2014-08-01 to ...  [1347431, 100]  \n",
        "7  Bag of Words in word count from 2015-01-01 to ...   [275331, 100]  "
       ]
      }
     ],
     "prompt_number": 9
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train([fw.features_log.feature_name[6]],\"LR\",\"forward_count\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loading features...\n",
        "loading label..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "training model..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "writing log..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "saving model..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "=====Results=====\n",
        "Coefficients: \n",
        "[  2.06847881e-01   2.95204645e+00  -2.26862813e+00   8.62576106e-01\n",
        "   8.97757828e-01   2.51369015e+00   1.00612558e-01  -1.32805265e+00\n",
        "   1.11389253e+00  -7.59924663e-01  -6.83897799e-01   1.38202601e+00\n",
        "  -1.39793531e-01  -2.90407167e-01   1.26903179e+00  -1.32686828e+00\n",
        "   1.29968172e+00  -1.09574074e-01  -7.58987931e-01   9.56693675e-01\n",
        "  -1.73775487e-01  -6.23143862e-02   1.60884953e-01  -2.67253030e-01\n",
        "  -1.35948921e+00   2.55049195e-01  -3.65807136e-01  -2.53126451e-01\n",
        "  -3.27996955e+00  -1.41268688e+00  -7.16436584e-01   5.19629908e-01\n",
        "  -9.59840581e-01  -1.07706297e+00   2.36107660e-01   4.97817571e-01\n",
        "  -5.40743699e-01  -5.90577577e-01   3.33311445e+00   7.47488732e-01\n",
        "   3.16647603e-01   1.22556472e+01   3.07203422e-01  -2.40773632e-01\n",
        "  -6.14862913e-01   3.27993495e-01  -1.23439754e+00   3.62763265e-01\n",
        "   1.01883105e-01   5.42813410e-01   8.22256028e-01   2.52346787e-01\n",
        "  -4.57915577e-01  -1.08972051e-01  -2.66056818e-01   2.84228889e-01\n",
        "   3.62817144e-01   9.57523346e-01  -1.39585382e-01   4.67840745e-01\n",
        "  -1.13761969e-01   1.02299636e+00   3.55447423e-01  -5.92659634e-02\n",
        "  -1.10820232e-01  -1.14162506e-01  -1.97397523e+00   1.59152668e-01\n",
        "   7.15964337e-01  -4.80772833e-01   1.87571064e-02   1.43267901e-05\n",
        "  -4.96913217e-01   1.45929220e+00   6.39834839e-01   1.66237444e+00\n",
        "  -3.09135839e-01  -4.45360280e-01  -7.17564749e-01   3.70364412e-01\n",
        "  -2.11058205e+00   7.62003026e-01  -1.48178040e-03   2.04718738e-01\n",
        "  -8.64279249e-01   1.69060569e+00   2.27858961e+00   3.37051400e-01\n",
        "   1.23816638e-01   2.08075188e+00   4.51773748e+00  -2.43510037e+00\n",
        "   5.08154814e-01   9.61719047e-01   1.22862557e-01  -1.34020099e+00\n",
        "   4.20854433e-03   6.40382642e+00  -1.76548966e-02  -1.65209043e+00]\n",
        "Residual sum of squares: 4431.37\n",
        "Variance score: 0.00\n",
        "Train time:  8.88659000397 seconds.\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 10,
       "text": [
        "LinearRegression(copy_X=True, fit_intercept=True, normalize=False)"
       ]
      }
     ],
     "prompt_number": 10
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "print ' '.join(f_model.get_feature_names())"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "app iphone it \u4e00\u4e0b \u4e00\u4e2a \u4e00\u4e9b \u4e00\u79cd \u4e00\u8d77 \u4e0b\u8f7d \u4e0d\u9519 \u4e16\u754c \u4e2d\u56fd \u4e92\u8054\u7f51 \u4ea7\u54c1 \u4eca\u5929 \u4eca\u65e5 \u4ee3\u7801 \u4f01\u4e1a \u4f53\u9a8c \u4f7f\u7528 \u4fe1\u606f \u514d\u8d39 \u516c\u53f8 \u5185\u5bb9 \u51c6\u5907 \u5206\u4eab \u529f\u80fd \u5317\u4eac \u5347\u7ea7 \u535a\u6587 \u53d1\u5c55 \u53d1\u5e03 \u53d1\u73b0 \u53d1\u8868 \u559c\u6b22 \u56f4\u89c2 \u56fe\u7247 \u5730\u5740 \u5b58\u50a8 \u5b66\u4e60 \u5b89\u5168 \u5b9e\u73b0 \u5c0f\u4f19\u4f34 \u5de5\u4f5c \u5df2\u7ecf \u5e02\u573a \u5e0c\u671b \u5e26\u6765 \u5e73\u53f0 \u5e94\u7528 \u5f00\u53d1 \u5fae\u535a \u5fae\u76d8 \u5fae\u8f6f \u611f\u89c9 \u6210\u4e3a \u6210\u529f \u624b\u673a \u6280\u672f \u63a8\u8350 \u63d0\u4f9b \u652f\u6301 \u6570\u636e \u65f6\u95f4 \u670b\u53cb \u670d\u52a1 \u6765\u81ea \u6b63\u5728 \u6d3b\u52a8 \u70b9\u51fb \u73b0\u5728 \u751f\u6d3b \u7528\u6237 \u754c\u9762 \u767e\u5ea6 \u770b\u5230 \u770b\u770b \u77e5\u9053 \u79d1\u6280 \u79fb\u52a8 \u7ba1\u7406 \u7cfb\u7edf \u7f51\u7ad9 \u7f51\u7edc \u7f8e\u56fd \u82f9\u679c \u83b7\u5f97 \u89c6\u9891 \u89c9\u5f97 \u8ba1\u7b97 \u8bbe\u8ba1 \u8bd5\u8bd5 \u8be6\u60c5 \u8f6f\u4ef6 \u8fdb\u884c \u94fe\u63a5 \u95ee\u9898 \u9700\u8981 \u9879\u76ee \u9886\u53d6\n"
       ]
      }
     ],
     "prompt_number": 59
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train([fw.features_log.feature_name[6]],\"LR\",\"comment_count\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loading features...\n",
        "loading label..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "training model..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "writing log..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "saving model..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "=====Results=====\n",
        "Coefficients: \n",
        "[ 0.35972618  0.4000895  -1.21104573  0.66278902  0.19069631  0.31515579\n",
        " -0.17783614 -0.26690446 -0.15043184 -0.30859189 -0.34868894  0.04138837\n",
        " -0.09165178 -0.07669461  0.72361734 -0.2580051   0.16395168 -0.11588005\n",
        " -0.25515504 -0.16121226 -0.04223672 -0.31285642  0.36010544 -0.07314647\n",
        " -0.01254728 -0.60492126 -0.09875533  0.23351687 -0.58643883 -0.7614594\n",
        " -0.22815389 -0.0166352  -0.02488022 -0.37414094 -0.00744296  0.19128539\n",
        " -0.17048185 -0.1164484   0.03714563  0.42040928 -0.17160519  0.99306407\n",
        "  0.05778066  0.2567584  -0.15188027  0.02912955 -0.3682348   0.00647912\n",
        " -0.02901257 -0.01701739  0.39594996 -0.26393848  0.20355575 -0.15397941\n",
        "  0.18093557 -0.06453988  0.05849045 -0.08464433 -0.06918366  0.31786986\n",
        " -0.15091659 -0.07699895  0.09000855  0.27599896 -0.09681884 -0.27132818\n",
        " -0.34959346  0.03436194 -0.69287407  0.29934273 -0.26087802  0.05805617\n",
        " -0.03937212  0.49957926  0.20040957  0.40837444 -0.32395736 -0.08475333\n",
        " -0.2707374   0.31904576 -0.5930225  -0.08400943 -0.03193357 -0.09396474\n",
        " -0.03968853  0.40238284 -0.04519938 -0.02723436  0.82447097  0.25897387\n",
        "  0.28756215 -0.98940718 -0.32177482 -0.05697542 -0.00865332 -0.60043769\n",
        "  0.24254075  0.42976788 -0.15109842 -0.65101749]\n",
        "Residual sum of squares: 462.23\n",
        "Variance score: 0.00\n",
        "Train time:  8.08010411263 seconds.\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 11,
       "text": [
        "LinearRegression(copy_X=True, fit_intercept=True, normalize=False)"
       ]
      }
     ],
     "prompt_number": 11
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train([fw.features_log.feature_name[6]],\"LR\",\"like_count\")"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loading features...\n",
        "loading label..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "training model..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "writing log..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "saving model..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "=====Results=====\n",
        "Coefficients: \n",
        "[ -2.69716150e-04  -1.87370720e-01  -9.80726362e-01   5.08722299e-01\n",
        "   3.98118167e-01   1.33984079e+00   1.12911219e-01  -4.06031219e-01\n",
        "   5.12860230e-01  -5.31963729e-01  -3.60108196e-01   4.10903962e-02\n",
        "  -8.25481052e-02  -2.89926494e-01   1.32208096e+00  -2.56142708e-01\n",
        "  -3.95513848e-02  -1.80285059e-01  -6.71887883e-01   5.88936064e-02\n",
        "  -1.21902982e-01  -3.84239450e-01  -2.05055365e-02  -1.69078831e-01\n",
        "  -1.01717661e+00   5.88647423e-02  -1.52814093e-01   9.65793091e-03\n",
        "  -1.35734716e+00  -7.23831656e-01  -1.99687913e-01   3.09457326e-02\n",
        "  -1.80898364e-01  -4.90393940e-01   3.64810450e-01   4.73889631e-01\n",
        "  -5.46307206e-01  -4.25349884e-01   8.49479418e-01  -2.14385481e-01\n",
        "  -2.99551849e-01   6.17633161e+00  -1.05585250e-01   3.57896683e-03\n",
        "  -1.85443601e-01   1.75792323e-01  -8.34636650e-01  -1.77951611e-01\n",
        "  -5.05012079e-02  -1.82554527e-01  -5.16995526e-01   6.56530121e-01\n",
        "   7.20072765e-02  -8.96660005e-02  -9.02823326e-02   2.30925805e-01\n",
        "  -8.29502467e-02  -3.64222265e-01  -1.64860373e-01   2.34649932e-01\n",
        "  -1.96869159e-01   9.99418554e-02   6.56946211e-02   7.61915701e-02\n",
        "  -1.68556801e-01  -2.17177651e-01  -9.30582210e-01  -5.92192229e-01\n",
        "  -6.45529285e-01  -1.00115823e-02  -3.30533720e-01   2.56573730e-03\n",
        "  -3.00693851e-01   8.52054796e-01   4.91852386e-01   2.40353157e-01\n",
        "  -1.35412251e-01  -2.47805001e-01  -2.16177478e-01  -2.43528418e-01\n",
        "  -1.22639301e+00   1.79132539e-01  -2.63702526e-02  -1.73865313e-01\n",
        "  -4.46960334e-02  -2.78501490e-01  -1.40571630e-01  -1.03145526e-01\n",
        "   1.28625810e+00  -1.13731618e-01   2.05742682e+00  -1.16262090e+00\n",
        "  -6.27243797e-01   8.28933692e-03   2.95437353e-02  -6.98265898e-01\n",
        "  -1.70585379e-01   3.46550322e+00  -1.95060605e-01  -2.33571938e-01]\n",
        "Residual sum of squares: 444.90\n",
        "Variance score: 0.00\n",
        "Train time:  7.57832098007 seconds.\n"
       ]
      },
      {
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 13,
       "text": [
        "LinearRegression(copy_X=True, fit_intercept=True, normalize=False)"
       ]
      }
     ],
     "prompt_number": 13
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.train_log"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>model_name</th>\n",
        "      <th>features</th>\n",
        "      <th>model_type</th>\n",
        "      <th>label</th>\n",
        "      <th>model_parameters</th>\n",
        "      <th>evaluation</th>\n",
        "      <th>model_address</th>\n",
        "      <th>train_time</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> forward_count</td>\n",
        "      <td> {}</td>\n",
        "      <td> {u'sos': 9684.32149315, u'vs': 0.000830103758837}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  9.537309</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> comment_count</td>\n",
        "      <td> {}</td>\n",
        "      <td> {u'sos': 1417.51504491, u'vs': 0.000417400999493}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td> 10.308280</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td>    like_count</td>\n",
        "      <td> {}</td>\n",
        "      <td>   {u'sos': 531.036859608, u'vs': 0.0026936623626}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  8.627647</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> forward_count</td>\n",
        "      <td> {}</td>\n",
        "      <td> {u'sos': 9685.37278533, u'vs': 0.000721637770984}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  3.512632</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> comment_count</td>\n",
        "      <td> {}</td>\n",
        "      <td> {u'sos': 1417.65270887, u'vs': 0.000320325135543}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  3.313389</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td>    like_count</td>\n",
        "      <td> {}</td>\n",
        "      <td>  {u'sos': 531.249749817, u'vs': 0.00229384688738}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  3.521944</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> forward_count</td>\n",
        "      <td> {}</td>\n",
        "      <td>  {u'sos': 9688.23725803, u'vs': 0.00042609875037}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  1.904893</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> comment_count</td>\n",
        "      <td> {}</td>\n",
        "      <td> {u'sos': 1417.72441755, u'vs': 0.000269758653194}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  1.952324</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8 </th>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...</td>\n",
        "      <td> LR</td>\n",
        "      <td>    like_count</td>\n",
        "      <td> {}</td>\n",
        "      <td>  {u'sos': 531.846443246, u'vs': 0.00117323514865}</td>\n",
        "      <td> ../models/BOW_2014-07-01_2014-11-30_2014-07-01...</td>\n",
        "      <td>  1.821382</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9 </th>\n",
        "      <td> BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...</td>\n",
        "      <td> [BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> forward_count</td>\n",
        "      <td> {}</td>\n",
        "      <td>  {u'sos': 4431.37016298, u'vs': 0.00164927062079}</td>\n",
        "      <td> ../models/BOW_2014-08-01_2014-12-31_2014-08-01...</td>\n",
        "      <td>  8.886590</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10</th>\n",
        "      <td> BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...</td>\n",
        "      <td> [BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-...</td>\n",
        "      <td> LR</td>\n",
        "      <td> comment_count</td>\n",
        "      <td> {}</td>\n",
        "      <td> {u'sos': 462.230246661, u'vs': 0.000737975003168}</td>\n",
        "      <td> ../models/BOW_2014-08-01_2014-12-31_2014-08-01...</td>\n",
        "      <td>  8.080104</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11</th>\n",
        "      <td> BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...</td>\n",
        "      <td> [BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-...</td>\n",
        "      <td> LR</td>\n",
        "      <td>    like_count</td>\n",
        "      <td> {}</td>\n",
        "      <td>  {u'sos': 444.898179577, u'vs': 0.00362202943829}</td>\n",
        "      <td> ../models/BOW_2014-08-01_2014-12-31_2014-08-01...</td>\n",
        "      <td>  7.578321</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 14,
       "text": [
        "                                           model_name  \\\n",
        "0   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "1   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "2   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "3   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "4   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "5   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "6   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "7   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "8   BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "9   BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...   \n",
        "10  BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...   \n",
        "11  BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-3...   \n",
        "\n",
        "                                             features model_type  \\\n",
        "0   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "1   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "2   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "3   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "4   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "5   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "6   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "7   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "8   [BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-...         LR   \n",
        "9   [BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-...         LR   \n",
        "10  [BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-...         LR   \n",
        "11  [BOW_2014-08-01_2014-12-31_2014-08-01_2014-12-...         LR   \n",
        "\n",
        "            label model_parameters  \\\n",
        "0   forward_count               {}   \n",
        "1   comment_count               {}   \n",
        "2      like_count               {}   \n",
        "3   forward_count               {}   \n",
        "4   comment_count               {}   \n",
        "5      like_count               {}   \n",
        "6   forward_count               {}   \n",
        "7   comment_count               {}   \n",
        "8      like_count               {}   \n",
        "9   forward_count               {}   \n",
        "10  comment_count               {}   \n",
        "11     like_count               {}   \n",
        "\n",
        "                                           evaluation  \\\n",
        "0   {u'sos': 9684.32149315, u'vs': 0.000830103758837}   \n",
        "1   {u'sos': 1417.51504491, u'vs': 0.000417400999493}   \n",
        "2     {u'sos': 531.036859608, u'vs': 0.0026936623626}   \n",
        "3   {u'sos': 9685.37278533, u'vs': 0.000721637770984}   \n",
        "4   {u'sos': 1417.65270887, u'vs': 0.000320325135543}   \n",
        "5    {u'sos': 531.249749817, u'vs': 0.00229384688738}   \n",
        "6    {u'sos': 9688.23725803, u'vs': 0.00042609875037}   \n",
        "7   {u'sos': 1417.72441755, u'vs': 0.000269758653194}   \n",
        "8    {u'sos': 531.846443246, u'vs': 0.00117323514865}   \n",
        "9    {u'sos': 4431.37016298, u'vs': 0.00164927062079}   \n",
        "10  {u'sos': 462.230246661, u'vs': 0.000737975003168}   \n",
        "11   {u'sos': 444.898179577, u'vs': 0.00362202943829}   \n",
        "\n",
        "                                        model_address  train_time  \n",
        "0   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    9.537309  \n",
        "1   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...   10.308280  \n",
        "2   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    8.627647  \n",
        "3   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    3.512632  \n",
        "4   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    3.313389  \n",
        "5   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    3.521944  \n",
        "6   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    1.904893  \n",
        "7   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    1.952324  \n",
        "8   ../models/BOW_2014-07-01_2014-11-30_2014-07-01...    1.821382  \n",
        "9   ../models/BOW_2014-08-01_2014-12-31_2014-08-01...    8.886590  \n",
        "10  ../models/BOW_2014-08-01_2014-12-31_2014-08-01...    8.080104  \n",
        "11  ../models/BOW_2014-08-01_2014-12-31_2014-08-01...    7.578321  "
       ]
      }
     ],
     "prompt_number": 14
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.test([fw.features_log.feature_name[7]],fw.train_log.model_name[9],fw.train_log.model_name[10],fw.train_log.model_name[11],evaluation=False)"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "loading features...\n",
        "loading models..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "predicting...\n",
        "writing logs..."
       ]
      },
      {
       "output_type": "stream",
       "stream": "stdout",
       "text": [
        "\n",
        "genelizing results...\n"
       ]
      },
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>comment_predict</th>\n",
        "      <th>forward_predict</th>\n",
        "      <th>like_predict</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2     </th>\n",
        "      <td> 2</td>\n",
        "      <td> 4</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>3     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>4     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 6</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>5     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>6     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>7     </th>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>8     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>9     </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>10    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>11    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>12    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>13    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>14    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>15    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>16    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>17    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>18    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>19    </th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>20    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>21    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>22    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>23    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>24    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>25    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>26    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>27    </th>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>28    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 5</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>29    </th>\n",
        "      <td> 2</td>\n",
        "      <td> 9</td>\n",
        "      <td> 4</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>...</th>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "      <td>...</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275301</th>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275302</th>\n",
        "      <td> 0</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275303</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275304</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275305</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275306</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275307</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275308</th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275309</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275310</th>\n",
        "      <td> 2</td>\n",
        "      <td> 3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275311</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275312</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275313</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275314</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275315</th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275316</th>\n",
        "      <td> 0</td>\n",
        "      <td> 3</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275317</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275318</th>\n",
        "      <td> 1</td>\n",
        "      <td> 5</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275319</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275320</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275321</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275322</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275323</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275324</th>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275325</th>\n",
        "      <td> 1</td>\n",
        "      <td> 0</td>\n",
        "      <td> 0</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275326</th>\n",
        "      <td> 2</td>\n",
        "      <td> 5</td>\n",
        "      <td> 3</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275327</th>\n",
        "      <td> 2</td>\n",
        "      <td> 3</td>\n",
        "      <td> 2</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275328</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275329</th>\n",
        "      <td> 1</td>\n",
        "      <td> 4</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>275330</th>\n",
        "      <td> 1</td>\n",
        "      <td> 2</td>\n",
        "      <td> 1</td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "<p>275331 rows \u00d7 3 columns</p>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 16,
       "text": [
        "        comment_predict  forward_predict  like_predict\n",
        "0                     1                2             1\n",
        "1                     1                2             1\n",
        "2                     2                4             1\n",
        "3                     1                2             1\n",
        "4                     1                6             0\n",
        "5                     1                2             1\n",
        "6                     1                2             1\n",
        "7                     2                1             1\n",
        "8                     1                0             1\n",
        "9                     1                2             1\n",
        "10                    2                2             2\n",
        "11                    1                2             1\n",
        "12                    1                2             2\n",
        "13                    1                2             1\n",
        "14                    1                2             1\n",
        "15                    1                2             1\n",
        "16                    1                2             1\n",
        "17                    1                0             0\n",
        "18                    0                0             0\n",
        "19                    0                0             0\n",
        "20                    1                0             1\n",
        "21                    1                0             1\n",
        "22                    1                2             1\n",
        "23                    2                2             1\n",
        "24                    2                2             1\n",
        "25                    2                2             1\n",
        "26                    1                1             1\n",
        "27                    1                1             1\n",
        "28                    2                5             3\n",
        "29                    2                9             4\n",
        "...                 ...              ...           ...\n",
        "275301                0                2             2\n",
        "275302                0                2             1\n",
        "275303                1                2             1\n",
        "275304                1                2             1\n",
        "275305                1                2             1\n",
        "275306                1                2             1\n",
        "275307                1                2             1\n",
        "275308                1                4             2\n",
        "275309                1                2             1\n",
        "275310                2                3             2\n",
        "275311                1                2             1\n",
        "275312                1                2             1\n",
        "275313                1                2             1\n",
        "275314                1                2             1\n",
        "275315                1                4             2\n",
        "275316                0                3             0\n",
        "275317                1                2             1\n",
        "275318                1                5             2\n",
        "275319                1                2             1\n",
        "275320                1                2             1\n",
        "275321                1                2             2\n",
        "275322                0                0             0\n",
        "275323                1                0             0\n",
        "275324                0                0             0\n",
        "275325                1                0             0\n",
        "275326                2                5             3\n",
        "275327                2                3             2\n",
        "275328                1                2             1\n",
        "275329                1                4             1\n",
        "275330                1                2             1\n",
        "\n",
        "[275331 rows x 3 columns]"
       ]
      }
     ],
     "prompt_number": 16
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [
      "fw.test_log"
     ],
     "language": "python",
     "metadata": {},
     "outputs": [
      {
       "html": [
        "<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
        "<table border=\"1\" class=\"dataframe\">\n",
        "  <thead>\n",
        "    <tr style=\"text-align: right;\">\n",
        "      <th></th>\n",
        "      <th>test_name</th>\n",
        "      <th>features</th>\n",
        "      <th>fmodel</th>\n",
        "      <th>cmodel</th>\n",
        "      <th>lmodel</th>\n",
        "      <th>dev_f</th>\n",
        "      <th>dev_c</th>\n",
        "      <th>dev_l</th>\n",
        "      <th>precision</th>\n",
        "      <th>model_evaluation</th>\n",
        "      <th>result_address</th>\n",
        "    </tr>\n",
        "  </thead>\n",
        "  <tbody>\n",
        "    <tr>\n",
        "      <th>0</th>\n",
        "      <td> BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> 0.1722268</td>\n",
        "      <td> 0.06171658</td>\n",
        "      <td>  0.0703677</td>\n",
        "      <td> 0.2097326</td>\n",
        "      <td> {u'lvs': 0.00334535453203, u'lsos': 347.893983...</td>\n",
        "      <td> </td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>1</th>\n",
        "      <td> BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> 0.1626559</td>\n",
        "      <td> 0.05916317</td>\n",
        "      <td> 0.06798243</td>\n",
        "      <td>  0.209855</td>\n",
        "      <td> {u'lvs': 0.00289104028434, u'lsos': 348.001239...</td>\n",
        "      <td> </td>\n",
        "    </tr>\n",
        "    <tr>\n",
        "      <th>2</th>\n",
        "      <td> BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...</td>\n",
        "      <td> [BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...</td>\n",
        "      <td> 0.1917207</td>\n",
        "      <td>  0.1612881</td>\n",
        "      <td>  0.1622014</td>\n",
        "      <td> 0.2087247</td>\n",
        "      <td> {u'lvs': -0.00954419796209, u'lsos': 352.59353...</td>\n",
        "      <td> </td>\n",
        "    </tr>\n",
        "  </tbody>\n",
        "</table>\n",
        "</div>"
       ],
       "metadata": {},
       "output_type": "pyout",
       "prompt_number": 83,
       "text": [
        "                                           test_name  \\\n",
        "0  BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...   \n",
        "1  BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...   \n",
        "2  BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-3...   \n",
        "\n",
        "                                            features  \\\n",
        "0  [BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-...   \n",
        "1  [BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-...   \n",
        "2  [BOW_2014-12-01_2014-12-31_2014-07-01_2014-11-...   \n",
        "\n",
        "                                              fmodel  \\\n",
        "0  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "1  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "2  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "\n",
        "                                              cmodel  \\\n",
        "0  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "1  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "2  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...   \n",
        "\n",
        "                                              lmodel      dev_f       dev_c  \\\n",
        "0  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...  0.1722268  0.06171658   \n",
        "1  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...  0.1626559  0.05916317   \n",
        "2  BOW_2014-07-01_2014-11-30_2014-07-01_2014-11-3...  0.1917207   0.1612881   \n",
        "\n",
        "        dev_l  precision                                   model_evaluation  \\\n",
        "0   0.0703677  0.2097326  {u'lvs': 0.00334535453203, u'lsos': 347.893983...   \n",
        "1  0.06798243   0.209855  {u'lvs': 0.00289104028434, u'lsos': 348.001239...   \n",
        "2   0.1622014  0.2087247  {u'lvs': -0.00954419796209, u'lsos': 352.59353...   \n",
        "\n",
        "  result_address  \n",
        "0                 \n",
        "1                 \n",
        "2                 "
       ]
      }
     ],
     "prompt_number": 83
    },
    {
     "cell_type": "code",
     "collapsed": false,
     "input": [],
     "language": "python",
     "metadata": {},
     "outputs": []
    }
   ],
   "metadata": {}
  }
 ]
}